Merge remote-tracking branch 'origin/1.0' into 1.0
| | |
| | | } |
| | | |
| | | @PostMapping("/logan/inner/xpOperationsUser/pageListByIds") |
| | | public R<List<XpOperationsUserWithRoleVO>> pageListByIds(@RequestBody OptionalUsersPageListQuery q) { |
| | | public R<PageInfo<XpOperationsUserWithRoleVO>> pageListByIds(@RequestBody OptionalUsersPageListQuery q) { |
| | | return R.ok(xpOperationsUserService.pageListByIds(q)); |
| | | } |
| | | |
| | |
| | | */ |
| | | List<ExportOperationsUserVo> exportOperationsUser(@Param("query")XpOperationsUserQuery query); |
| | | |
| | | List<XpOperationsUserWithRoleVO> pageListByIds(OptionalUsersPageListQuery q); |
| | | List<XpOperationsUserWithRoleVO> pageListByIds(PageInfo<XpOperationsUserWithRoleVO> pageInfo, OptionalUsersPageListQuery q); |
| | | } |
| | |
| | | */ |
| | | List<XpOperationsUser> getByPhoneNumber(String phoneNumber); |
| | | |
| | | List<XpOperationsUserWithRoleVO> pageListByIds(OptionalUsersPageListQuery q); |
| | | PageInfo<XpOperationsUserWithRoleVO> pageListByIds(OptionalUsersPageListQuery q); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<XpOperationsUserWithRoleVO> pageListByIds(OptionalUsersPageListQuery q) { |
| | | return baseMapper.pageListByIds(q); |
| | | public PageInfo<XpOperationsUserWithRoleVO> pageListByIds(OptionalUsersPageListQuery q) { |
| | | |
| | | PageInfo<XpOperationsUserWithRoleVO> pageInfo = new PageInfo<>(q.getPageNum(), q.getPageSize()); |
| | | List<XpOperationsUserWithRoleVO> list = baseMapper.pageListByIds(pageInfo, q); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | import com.xiaopeng.api.feignClient.pushMessage.WebSocketMessageClient; |
| | | import com.xiaopeng.api.vo.XpTaskVO; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class WebSocketMessageFallbackFactory implements FallbackFactory<WebSocketMessageClient> { |
| | | @Override |
| | | public WebSocketMessageClient create(Throwable cause) { |
| | | return new WebSocketMessageClient() { |
| | | @Override |
| | | public R<String> pushTask(XpTaskVO dto) { |
| | | log.error("发送失败 {}", cause.getMessage()); |
| | | return R.fail("发送失败"); |
| | | } |
| | | |
| | |
| | | private Long timeRemain; |
| | | |
| | | public Long getTimeRemain() { |
| | | if (endTime != null) return null; |
| | | if (endTime == null) return null; |
| | | return LocalDateTime.now().until(endTime, java.time.temporal.ChronoUnit.SECONDS); |
| | | } |
| | | |
| | |
| | | private List<SysRole> roles; |
| | | |
| | | @ApiModelProperty(value = "和事故地点距离") |
| | | private String dis; |
| | | private Double dis; |
| | | } |
| | |
| | | com.xiaopeng.api.factory.maintenance.XpVehicleModelClientFallbackFactory |
| | | com.xiaopeng.api.factory.operation.XpTargetedServiceClientFallbackFactory |
| | | com.xiaopeng.api.factory.vehicleConvoy.VehicleMacClientFallbackFactory |
| | | com.xiaopeng.api.factory.account.XpOperationsUserClientFallbackFactory |
| | | com.xiaopeng.api.factory.account.XpOperationsUserClientFallbackFactory |
| | | com.xiaopeng.api.factory.pushMessage.WebSocketMessageFallbackFactory |
| | |
| | | PageInfo<XpOperationsUserWithRoleVO> ret = operationUserClient.listByQueryIds(query).getData(); |
| | | |
| | | // 设置距离,然后排序 |
| | | ret.getRecords().forEach(e -> e.setDis(String.valueOf(disMap.get(e.getId())))); |
| | | |
| | | if (ret == null || ret.getRecords() == null || ret.getRecords().isEmpty()) { |
| | | return R.ok(); |
| | | } |
| | | ret.getRecords().forEach(e -> e.setDis(disMap.get(e.getId()))); |
| | | List<XpOperationsUserWithRoleVO> sorted = ret.getRecords().stream().sorted(Comparator.comparing(XpOperationsUserWithRoleVO::getDis)).collect(Collectors.toList()); |
| | | ret.setRecords(sorted); |
| | | return R.ok(ret); |
| | |
| | | |
| | | List<XpTaskVO> reassignTaskPageList(@Param("pageInfo")PageInfo<XpTaskVO> pageInfo, @Param("query")TaskPageListQuery query); |
| | | |
| | | List<XpTaskVO> reassignTaskPageList(TaskPageListQuery query); |
| | | List<XpTaskVO> reassignTaskPageList(@Param("query") TaskPageListQuery query); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Resource |
| | | WebSocketMessageClient xpWebSocketMessageClient; |
| | | /** |
| | | * 推送阿里云通知 |
| | |
| | | |
| | | @ApiModelProperty(value = "打卡时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Excel(name = "打卡时间", width = 20) |
| | | @Excel(name = "打卡时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime checkInTime; |
| | | |
| | | @ApiModelProperty(value = "打卡结果(1=正常打卡,2=迟到打卡,3=未打卡)") |
| | |
| | | LEFT JOIN xp_vehicle v ON t.vehicle_id = v.id AND v.is_deleted = 0 |
| | | LEFT JOIN xp_error_type et ON t.error_type_id = et.id |
| | | WHERE t.is_deleted = 0 |
| | | AND t.reassignment_status = 1 |
| | | AND t.status = 4 |
| | | <if test="query.taskCategory != null"> |
| | | AND t.task_category = #{query.taskCategory} |
| | | </if> |
| | |
| | | |
| | | |
| | | import com.xiaopeng.api.dto.operation.XpActivityDto; |
| | | import com.xiaopeng.api.model.operation.*; |
| | | import com.xiaopeng.api.feignClient.account.XpAppUserCouponClient; |
| | | import com.xiaopeng.api.model.account.XpAppUserCoupon; |
| | | import com.xiaopeng.api.model.operation.XpActicityCoupon; |
| | |
| | | import com.xiaopeng.common.core.constant.CacheConstants; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.service.*; |
| | | import com.xiaopeng.operation.service.IXpActicityCouponService; |
| | | import com.xiaopeng.operation.service.IXpActicityService; |
| | | import com.xiaopeng.operation.service.IXpActicityStrategyService; |
| | |
| | | |
| | | |
| | | |
| | | @Resource |
| | | IXpActicityStrategyService strategyService; |
| | | @Resource |
| | | IXpActicityUserService userService; |
| | | @Resource |
| | | IXpActivityNoticeService noticeService; |
| | | |
| | | @PostMapping("/v1/api/appUserCoupon/pageList") |
| | | @ApiOperation(value = "活动列表",tags = {"管理后台-活动管理"},response = XpActivity.class) |
| | | public R<PageInfo<XpActivity>> pageList(@RequestBody XpActivityPageListQuery query) { |
| | | PageInfo<XpActivity> pageList = service.pageList(query); |
| | | public R<PageInfo<XpActivityDto>> pageList(@RequestBody XpActivityPageListQuery query) { |
| | | PageInfo<XpActivityDto> pageList = service.pageList(query); |
| | | for (XpActivityDto dto : pageList.getRecords()) { |
| | | List<XpActicityStrategy> strategies = strategyService.lambdaQuery().eq(XpActicityStrategy::getActitcityId, dto.getId()).list(); |
| | | dto.setStrategy(strategies); |
| | | dto.setActivityUser(userService.lambdaQuery().eq(XpActicityUser::getActitcityId, dto.getId()).list()); |
| | | dto.setNotice(noticeService.lambdaQuery().eq(XpActivityNotice::getActivityId, dto.getId()).one()); |
| | | } |
| | | return R.ok(pageList); |
| | | } |
| | | |
| | |
| | | package com.xiaopeng.operation.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.xiaopeng.api.dto.operation.XpActivityDto; |
| | | import com.xiaopeng.api.model.operation.XpActivity; |
| | | import com.xiaopeng.api.query.operation.XpActivityPageListQuery; |
| | | import com.xiaopeng.api.vo.operation.XpActivityVo; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | public interface XpActicityMapper extends BaseMapper<XpActivity> { |
| | | |
| | | List<XpActivity> pageList(PageInfo<XpActivity> pageInfo, XpActivityPageListQuery query); |
| | | List<XpActivityDto> pageList(PageInfo<XpActivityDto> pageInfo, XpActivityPageListQuery query); |
| | | } |
| | |
| | | import com.xiaopeng.api.dto.operation.XpActivityDto; |
| | | import com.xiaopeng.api.model.operation.XpActivity; |
| | | import com.xiaopeng.api.query.operation.XpActivityPageListQuery; |
| | | import com.xiaopeng.api.vo.operation.XpActivityVo; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | public interface IXpActicityService extends IService<XpActivity> { |
| | | |
| | | PageInfo<XpActivity> pageList(XpActivityPageListQuery query); |
| | | PageInfo<XpActivityDto> pageList(XpActivityPageListQuery query); |
| | | |
| | | List<String> findListToIds(String acticityName); |
| | | |
| | |
| | | import com.xiaopeng.api.model.operation.XpActivity; |
| | | import com.xiaopeng.api.model.operation.XpActivityNotice; |
| | | import com.xiaopeng.api.query.operation.XpActivityPageListQuery; |
| | | import com.xiaopeng.api.vo.operation.XpActivityVo; |
| | | import com.xiaopeng.common.core.utils.bean.BeanUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.operation.mapper.XpActicityMapper; |
| | |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<XpActivity> pageList(XpActivityPageListQuery query) { |
| | | PageInfo<XpActivity> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); |
| | | List<XpActivity> list = this.baseMapper.pageList(pageInfo,query); |
| | | public PageInfo<XpActivityDto> pageList(XpActivityPageListQuery query) { |
| | | PageInfo<XpActivityDto> pageInfo = new PageInfo<>(query.getPageNum(),query.getPageSize()); |
| | | List<XpActivityDto> list = this.baseMapper.pageList(pageInfo,query); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | <mapper namespace="com.xiaopeng.operation.mapper.XpActicityMapper"> |
| | | |
| | | |
| | | <select id="pageList" resultType="com.xiaopeng.api.model.operation.XpActivity"> |
| | | <select id="pageList" resultType="com.xiaopeng.api.dto.operation.XpActivityDto"> |
| | | select a.* |
| | | from xp_acticity as a |
| | | where a.is_deleted = 0 |
| | |
| | | public R<?> pushTask(@RequestBody XpTaskVO vo) throws JsonProcessingException { |
| | | |
| | | String handleUserId = vo.getHandleUserId(); |
| | | Map<String, Object> msg = new HashMap(); |
| | | Map<String, Object> msg = new HashMap<>(); |
| | | msg.put("type", "task"); |
| | | msg.put("data", vo); |
| | | webSocketUserService.sendMessageToUser(handleUserId, om.writeValueAsString(msg)); |
| | |
| | | if (vehiclePictures != null) { |
| | | JSONObject jsonObject = JSON.parseObject(vehiclePictures); |
| | | // 1 |
| | | String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | jsonObject.put("url", downloadUrl); |
| | | // String downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | // jsonObject.put("url", downloadUrl); |
| | | jsonObject.put("url", ""); |
| | | xpVehicle.setVehiclePictures(jsonObject.toJSONString()); |
| | | } |
| | | |
| | |
| | | continue; |
| | | } |
| | | String downloadUrl = null; |
| | | try { |
| | | downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | } catch (UnsupportedEncodingException e) { |
| | | log.error("获取图片下载地址失败", e); |
| | | } |
| | | // try { |
| | | // downloadUrl = aliOssService.getDownloadUrl(jsonObject.getString("id"), jsonObject.getString("name"), true); |
| | | // } catch (UnsupportedEncodingException e) { |
| | | // log.error("获取图片下载地址失败", e); |
| | | // } |
| | | jsonObject.put("url", downloadUrl); |
| | | } |
| | | record.setPolicyInformation(JSONArray.toJSONString(jsonArray)); |