| | |
| | | import cn.exrick.xboot.core.common.utils.ResultUtil; |
| | | import cn.exrick.xboot.core.common.vo.PageVo; |
| | | import cn.exrick.xboot.core.common.vo.Result; |
| | | import cn.exrick.xboot.core.entity.User; |
| | | import cn.exrick.xboot.core.service.UserService; |
| | | import cn.exrick.xboot.your.entity.*; |
| | | import cn.exrick.xboot.your.service.*; |
| | | import cn.exrick.xboot.your.util.HaiKangPost; |
| | | import cn.exrick.xboot.your.vo.AlarmVo; |
| | | import cn.exrick.xboot.your.vo.PreviewURLsVo; |
| | | import cn.exrick.xboot.your.vo.TalkURLsVo; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | private ICustomerService iCustomerService; |
| | | |
| | | @Autowired |
| | | private ICustomerReceiveService iCustomerReceiveService; |
| | | private IOrderTask2Service iOrderTask2Service; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @Autowired |
| | | private IDuoZhengService iDuoZhengService; |
| | |
| | | map.put("children",childrens); |
| | | return new ResultUtil<Object>().setData(map); |
| | | } |
| | | |
| | | @RequestMapping(value = "/test", method = RequestMethod.GET) |
| | | @ApiOperation(value = "测试接口,没用") |
| | | public String test(){ |
| | | List<OrderTask> list = iOrderTaskService.list(); |
| | | |
| | | List<OrderTask2> list2 = new ArrayList<>(); |
| | | for(OrderTask orderTask:list){ |
| | | OrderTask2 orderTask2 = new OrderTask2(); |
| | | BeanUtil.copyProperties(orderTask,orderTask2); |
| | | |
| | | if(orderTask.getUserId()!=null){ |
| | | orderTask2.setUserName(getUser(orderTask.getUserId())); |
| | | } |
| | | if(orderTask.getCustomerId()!=null){ |
| | | orderTask2.setCustomerName(getCustomer(orderTask.getCustomerId())); |
| | | } |
| | | list2.add(orderTask2); |
| | | } |
| | | iOrderTask2Service.saveBatch(list2); |
| | | return list.size()+"ok"; |
| | | } |
| | | |
| | | private String getUser(String id){ |
| | | User user = userService.get(id); |
| | | if(user!=null){ |
| | | return user.getNickname(); |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | private String getCustomer(String id){ |
| | | Customer customer = iCustomerService.getById(id); |
| | | if(customer!=null){ |
| | | return customer.getName(); |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | } |