| | |
| | | import cn.exrick.xboot.core.common.utils.SecurityUtil; |
| | | import cn.exrick.xboot.core.common.vo.PageVo; |
| | | import cn.exrick.xboot.core.common.vo.Result; |
| | | import cn.exrick.xboot.core.entity.Department; |
| | | import cn.exrick.xboot.core.entity.User; |
| | | import cn.exrick.xboot.core.service.DepartmentService; |
| | | import cn.exrick.xboot.core.service.UserService; |
| | | import cn.exrick.xboot.your.entity.*; |
| | | import cn.exrick.xboot.your.service.*; |
| | |
| | | @Autowired |
| | | private ICarService iCarService; |
| | | |
| | | @Autowired |
| | | private DepartmentService departmentService; |
| | | |
| | | @Autowired |
| | | private IEventLogService iEventLogService; |
| | | |
| | | @RequestMapping(value = "/get/{id}", method = RequestMethod.GET) |
| | | @ApiOperation(value = "通过id获取") |
| | | public Result<OrderTask> get(@PathVariable String id) { |
| | |
| | | map.put("sum",sum); |
| | | map.put("name",""); |
| | | if(list.size()>0){ |
| | | String areaSectionId = list.get(0).getAreaSectionId(); |
| | | OrderTask orderTask = list.get(0); |
| | | String areaSectionId = orderTask.getAreaSectionId(); |
| | | AreaSection a = iAreaSectionService.getById(areaSectionId); |
| | | map.put("name",a.getName()); |
| | | Area area2 = iAreaService.getById(orderTask.getAreaId()); |
| | | map.put("name",area2.getName()+a.getName()); |
| | | list.clear(); |
| | | } |
| | | return new ResultUtil<Object>().setData(map); |
| | |
| | | } |
| | | } |
| | | map.put("content",content); |
| | | |
| | | map.put("lng",""); |
| | | map.put("lat",""); |
| | | String deptId = securityUtil.getCurrUser().getDepartmentId(); |
| | | if(StrUtil.isNotEmpty(deptId)){ |
| | | Department department = departmentService.get(deptId); |
| | | map.put("lng",department.getLng()); |
| | | map.put("lat",department.getLat()); |
| | | } |
| | | return new ResultUtil<Object>().setData(map); |
| | | } |
| | | |
| | |
| | | |
| | | @RequestMapping(value = "/signFor", method = RequestMethod.POST) |
| | | @ApiOperation(value = "签收") |
| | | public Object signFor(String orderId,int status,String content,String customerReceiveId) { |
| | | public Object signFor(String orderId,int status,String content,String customerReceiveId,int time) { |
| | | if(status==1){ |
| | | if(StrUtil.isEmpty(customerReceiveId)){ |
| | | return ResultUtil.error("正常签收,接货人id必填"); |
| | |
| | | OrderTask orderTask = iOrderTaskService.getById(orderId); |
| | | orderTask.setStatus(status); |
| | | orderTask.setUserId(securityUtil.getCurrUser().getId()); |
| | | orderTask.setTime(time); |
| | | if(StrUtil.isNotEmpty(customerReceiveId)){ |
| | | orderTask.setCustomerReceiveId(customerReceiveId); |
| | | } |
| | |
| | | } |
| | | } |
| | | iOrderTaskService.saveOrUpdate(orderTask); |
| | | |
| | | Car car = iCarService.getById(orderTask.getCarId()); |
| | | EventLog eventLog = new EventLog(); |
| | | eventLog.setCarNo(car.getCarNo()); |
| | | eventLog.setRefId(orderId); |
| | | eventLog.setType(6);//6:配送完成 |
| | | iEventLogService.saveOrUpdate(eventLog); |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | |