| | |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.page.PageInfoBT; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.core.util.WoUtil; |
| | | import com.stylefeng.guns.modular.system.dao.DriverPunishMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DriverProfileAuditMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DriverTrainMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | |
| | | private ITDriverServiceService tDriverServiceService; |
| | | |
| | | @Autowired |
| | | private IDriverProfileAuditService driverProfileAuditService; |
| | | |
| | | @Autowired |
| | | private ITDriverLineService tDriverLineService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Resource |
| | | private DriverPunishMapper driverPunishMapper; |
| | | |
| | | @Resource |
| | | private DriverProfileAuditMapper driverProfileAuditMapper; |
| | | |
| | | @Resource |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | |
| | | |
| | | @Autowired |
| | | private IDriverWorkService iDriverWorkService; |
| | | @Autowired |
| | | private IEnterpriseConfigService enterpriseConfigService; |
| | | @Autowired |
| | | private ITRegionService regionService; |
| | | @Autowired |
| | |
| | | |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | model.addAttribute("enterpriseConfigList", getEnableEnterpriseConfigList()); |
| | | return PREFIX + "tDriver_add.html"; |
| | | } |
| | | |
| | |
| | | * 跳转到修改审核司机 |
| | | */ |
| | | @RequestMapping("/tDriver_immediately/{tDriverId}") |
| | | public String tDriver_immediately(@PathVariable Integer tDriverId, Model model) { |
| | | Map<String, Object> tDriver = tDriverService.getDriverById(tDriverId); |
| | | public String tDriver_immediately(@PathVariable Integer tDriverId, Model model, Integer auditType) { |
| | | Map<String, Object> tDriver; |
| | | // auditType=2 表示资料修改审核,详情页展示待审核表中的新资料。 |
| | | if (Integer.valueOf(2).equals(auditType)) { |
| | | tDriver = driverProfileAuditMapper.getProfileAuditById(tDriverId); |
| | | if (tDriver == null) { |
| | | model.addAttribute("item", new HashMap<String, Object>()); |
| | | model.addAttribute("placeOfPractice", ""); |
| | | return PREFIX + "tDriver_immediately.html"; |
| | | } |
| | | } else { |
| | | tDriver = tDriverService.getDriverById(tDriverId); |
| | | tDriver.put("auditType", 1); |
| | | } |
| | | model.addAttribute("item",tDriver); |
| | | |
| | | //处理从业地字段 |
| | |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | model.addAttribute("enterpriseConfigList", getEnableEnterpriseConfigList()); |
| | | return PREFIX + "tDriver_edit.html"; |
| | | } |
| | | |
| | | private List<EnterpriseConfig> getEnableEnterpriseConfigList() { |
| | | return enterpriseConfigService.selectList(new EntityWrapper<EnterpriseConfig>().eq("state", 1).orderBy("id", false)); |
| | | } |
| | | |
| | | /** |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> records; |
| | | // 审核列表同时展示注册审核和资料修改审核,前端通过 auditType 区分审核类型。 |
| | | if (ShiroKit.getUser().getRoleType() != 1) { |
| | | User user = userService.selectById(ShiroKit.getUser().getId()); |
| | | page.setRecords(tDriverService.getAuthDriverList(page, beginTime, endTime, companyName, phone, account, addType, authState, user.getObjectId())); |
| | | records = tDriverService.getAuthDriverList(new Page<Map<String, Object>>(1, 100000), beginTime, endTime, companyName, phone, account, addType, authState, user.getObjectId()); |
| | | records.addAll(driverProfileAuditMapper.getProfileAuditList(new Page<Map<String, Object>>(1, 100000), beginTime, endTime, companyName, phone, account, addType, authState, user.getObjectId())); |
| | | } else { |
| | | page.setRecords(tDriverService.getAuthDriverList(page, beginTime, endTime, companyName, phone, account, addType, authState, null)); |
| | | records = tDriverService.getAuthDriverList(new Page<Map<String, Object>>(1, 100000), beginTime, endTime, companyName, phone, account, addType, authState, null); |
| | | records.addAll(driverProfileAuditMapper.getProfileAuditList(new Page<Map<String, Object>>(1, 100000), beginTime, endTime, companyName, phone, account, addType, authState, null)); |
| | | } |
| | | return super.packForBT(page); |
| | | records.sort((o1, o2) -> String.valueOf(o2.get("insertTime")).compareTo(String.valueOf(o1.get("insertTime")))); |
| | | int fromIndex = Math.min((page.getCurrent() - 1) * page.getSize(), records.size()); |
| | | int toIndex = Math.min(fromIndex + page.getSize(), records.size()); |
| | | PageInfoBT<Map<String, Object>> result = new PageInfoBT<>(page); |
| | | result.setRows(records.subList(fromIndex, toIndex)); |
| | | result.setTotal(records.size()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @RequestMapping(value = "/authOpt") |
| | | @ResponseBody |
| | | public Object authOpt(Integer id,Integer authState) { |
| | | public Object authOpt(Integer id,Integer authState,Integer auditType) { |
| | | if (SinataUtil.isNotEmpty(id) && SinataUtil.isNotEmpty(authState)){ |
| | | // 资料修改审核通过后才把待审资料覆盖到司机主表;拒绝时只更新待审记录状态。 |
| | | if (Integer.valueOf(2).equals(auditType)) { |
| | | DriverProfileAudit audit = driverProfileAuditService.selectById(id); |
| | | if (audit == null) { |
| | | return new ErrorTip(500, "审核记录不存在"); |
| | | } |
| | | if (1 == authState) { |
| | | driverProfileAuditMapper.applyToDriver(audit); |
| | | // 服务模式以待审记录为准重建,避免旧服务模式残留。 |
| | | tDriverServiceService.delete(new EntityWrapper<TDriverService>().eq("driverId", audit.getDriverId())); |
| | | if (SinataUtil.isNotEmpty(audit.getServiceType())) { |
| | | String[] split = audit.getServiceType().split(","); |
| | | for (String t : split) { |
| | | if (SinataUtil.isNotEmpty(t)) { |
| | | TDriverService driverService = new TDriverService(); |
| | | driverService.setDriverId(audit.getDriverId()); |
| | | driverService.setType(Integer.valueOf(t)); |
| | | tDriverServiceService.insert(driverService); |
| | | } |
| | | } |
| | | } |
| | | audit.setAuditState(2); |
| | | } else { |
| | | audit.setAuditState(4); |
| | | } |
| | | audit.setAuditTime(new Date()); |
| | | audit.setAuditUser(ShiroKit.getUser().getId()); |
| | | driverProfileAuditService.updateById(audit); |
| | | return SUCCESS_TIP; |
| | | } |
| | | ShiroUser user1 = ShiroKit.getUser(); |
| | | User user2 = userService.selectById(user1.getId()); |
| | | TDriver tDriver = tDriverService.selectById(id); |