视频圈
This commit is contained in:
parent
d646c70feb
commit
b12cba30e8
|
@ -40,14 +40,14 @@ public class AppArtificerTimeController {
|
||||||
/**
|
/**
|
||||||
* @param idleTime 可接单时间
|
* @param idleTime 可接单时间
|
||||||
* @param busyTime 不可接单时间
|
* @param busyTime 不可接单时间
|
||||||
* @param userId
|
* @param artificerId 技师ID
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/setArtificerTime")
|
@PostMapping("/setArtificerTime")
|
||||||
@ApiOperation("设置时间管理")
|
@ApiOperation("设置时间管理")
|
||||||
@Login
|
@Login
|
||||||
public Result setArtificerTime(String idleTime,String busyTime,@RequestAttribute("userId") Long userId){
|
public Result setArtificerTime(String idleTime,String busyTime,Long artificerId){
|
||||||
return artificerTimeService.setArtificerTime( idleTime, busyTime, userId);
|
return artificerTimeService.setArtificerTime( idleTime, busyTime, artificerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,8 +58,8 @@ public class AppArtificerTimeController {
|
||||||
@PostMapping("/setArtificerAccept")
|
@PostMapping("/setArtificerAccept")
|
||||||
@ApiOperation("设置是否接单")
|
@ApiOperation("设置是否接单")
|
||||||
@Login
|
@Login
|
||||||
public Result setArtificerAccept(Integer flag,@RequestAttribute("userId") Long userId){
|
public Result setArtificerAccept(Integer flag,Long artificerId){
|
||||||
return artificerTimeService.setArtificerAccept( flag, userId);
|
return artificerTimeService.setArtificerAccept(flag, artificerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.sqx.modules.artificer.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.sqx.modules.artificer.entity.ArtificerTimeIdel;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ArtificerTimeIdelDao extends BaseMapper<ArtificerTimeIdel> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.sqx.modules.artificer.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description artificer_time_idel
|
||||||
|
* @author caolei
|
||||||
|
* @date 2024-08-28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("artificer_time_idel")
|
||||||
|
public class ArtificerTimeIdel implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 技师id
|
||||||
|
*/
|
||||||
|
private Long artificerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期
|
||||||
|
*/
|
||||||
|
private String artificerDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private String startTime;
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
public ArtificerTimeIdel() {}
|
||||||
|
}
|
|
@ -15,8 +15,8 @@ public interface ArtificerTimeService extends IService<ArtificerTime> {
|
||||||
|
|
||||||
Result selectArtificerTimeListByArtificerId(Long artificerId,String artificerDate);
|
Result selectArtificerTimeListByArtificerId(Long artificerId,String artificerDate);
|
||||||
|
|
||||||
Result setArtificerTime(String idleTime,String busyTime,Long userId);
|
Result setArtificerTime(String idleTime,String busyTime,Long artificerId);
|
||||||
|
|
||||||
Result setArtificerAccept(Integer flag,Long userId);
|
Result setArtificerAccept(Integer flag,Long artificerId);
|
||||||
|
|
||||||
}
|
}
|
|
@ -10,11 +10,9 @@ import com.sqx.modules.app.entity.UserMoney;
|
||||||
import com.sqx.modules.app.service.UserMoneyService;
|
import com.sqx.modules.app.service.UserMoneyService;
|
||||||
import com.sqx.modules.artificer.dao.ArtificerDao;
|
import com.sqx.modules.artificer.dao.ArtificerDao;
|
||||||
import com.sqx.modules.artificer.dao.ArtificerTimeDao;
|
import com.sqx.modules.artificer.dao.ArtificerTimeDao;
|
||||||
|
import com.sqx.modules.artificer.dao.ArtificerTimeIdelDao;
|
||||||
import com.sqx.modules.artificer.dao.OrdersDao;
|
import com.sqx.modules.artificer.dao.OrdersDao;
|
||||||
import com.sqx.modules.artificer.entity.Artificer;
|
import com.sqx.modules.artificer.entity.*;
|
||||||
import com.sqx.modules.artificer.entity.ArtificerTime;
|
|
||||||
import com.sqx.modules.artificer.entity.CollectArtificer;
|
|
||||||
import com.sqx.modules.artificer.entity.Orders;
|
|
||||||
import com.sqx.modules.artificer.service.ArtificerService;
|
import com.sqx.modules.artificer.service.ArtificerService;
|
||||||
import com.sqx.modules.artificer.service.ArtificerTimeService;
|
import com.sqx.modules.artificer.service.ArtificerTimeService;
|
||||||
import com.sqx.modules.artificer.service.CollectArtificerService;
|
import com.sqx.modules.artificer.service.CollectArtificerService;
|
||||||
|
@ -38,6 +36,8 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
|
||||||
private ArtificerService artificerService;
|
private ArtificerService artificerService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrdersDao ordersDao;
|
private OrdersDao ordersDao;
|
||||||
|
@Autowired
|
||||||
|
private ArtificerTimeIdelDao artificerTimeIdelDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result updateArtificerTime(String date,String times,Long userId){
|
public Result updateArtificerTime(String date,String times,Long userId){
|
||||||
|
@ -63,6 +63,26 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result selectArtificerTimeByArtificerId(Long artificerId,String artificerDate){
|
public Result selectArtificerTimeByArtificerId(Long artificerId,String artificerDate){
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
Artificer artificer = artificerService.getById(artificerId);
|
||||||
|
if(artificer.getAcceptOrders()==null){
|
||||||
|
map.put("acceptOrders", 1);
|
||||||
|
}else{
|
||||||
|
map.put("acceptOrders", artificer.getAcceptOrders());
|
||||||
|
}
|
||||||
|
ArtificerTimeIdel ati = artificerTimeIdelDao.selectOne(new QueryWrapper<ArtificerTimeIdel>()
|
||||||
|
.eq("artificer_id", artificerId)
|
||||||
|
.eq("artificer_date", artificerDate));
|
||||||
|
if(ati!=null){
|
||||||
|
map.put("startTime", ati.getStartTime());
|
||||||
|
map.put("endTime", ati.getEndTime());
|
||||||
|
}else{
|
||||||
|
map.put("startTime", artificerDate+" 00:00:00");
|
||||||
|
Date endDate = DateUtils.stringToDate(artificerDate,DateUtils.DATE_PATTERN);
|
||||||
|
endDate = DateUtils.addDateDays(endDate,1);
|
||||||
|
String endDateStr = DateUtils.format(endDate,DateUtils.DATE_PATTERN);
|
||||||
|
map.put("endTime", endDateStr+" 00:00:00");
|
||||||
|
}
|
||||||
List<ArtificerTime> artificerTimes = baseMapper.selectList(new QueryWrapper<ArtificerTime>()
|
List<ArtificerTime> artificerTimes = baseMapper.selectList(new QueryWrapper<ArtificerTime>()
|
||||||
.eq("artificer_id", artificerId)
|
.eq("artificer_id", artificerId)
|
||||||
.eq("artificer_date", artificerDate));
|
.eq("artificer_date", artificerDate));
|
||||||
|
@ -81,7 +101,8 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Result.success().put("data", artificerTimes);
|
map.put("data", artificerTimes);
|
||||||
|
return Result.success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -99,8 +120,8 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result setArtificerTime(String idleTime,String busyTime,Long userId){
|
public Result setArtificerTime(String idleTime,String busyTime,Long artificerId){
|
||||||
Artificer artificer = artificerService.selectArtificerByUserId(userId);
|
Artificer artificer = artificerService.getById(artificerId);
|
||||||
if(StringUtils.isNotEmpty(idleTime)){
|
if(StringUtils.isNotEmpty(idleTime)){
|
||||||
String[] idelTimes = idleTime.split(",");
|
String[] idelTimes = idleTime.split(",");
|
||||||
String[] datetime1 = idelTimes[0].split(" ");
|
String[] datetime1 = idelTimes[0].split(" ");
|
||||||
|
@ -117,6 +138,19 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
|
||||||
qw.le("artificer_time", endTime);
|
qw.le("artificer_time", endTime);
|
||||||
baseMapper.delete(qw);
|
baseMapper.delete(qw);
|
||||||
|
|
||||||
|
QueryWrapper qwi = new QueryWrapper<ArtificerTimeIdel>();
|
||||||
|
qwi.eq("artificer_id", artificer.getArtificerId());
|
||||||
|
qwi.eq("artificer_date", startDay);
|
||||||
|
artificerTimeIdelDao.delete(qwi);
|
||||||
|
|
||||||
|
ArtificerTimeIdel ati = new ArtificerTimeIdel();
|
||||||
|
ati.setArtificerId(artificer.getArtificerId());
|
||||||
|
ati.setArtificerDate(startDay);
|
||||||
|
ati.setStartTime(idelTimes[0]);
|
||||||
|
ati.setEndTime(idelTimes[1]);
|
||||||
|
ati.setCreateTime(DateUtils.format(new Date()));
|
||||||
|
artificerTimeIdelDao.insert(ati);
|
||||||
|
|
||||||
Map<String,List> dateMap = getIdelMap(idelTimes[0],idelTimes[1]);
|
Map<String,List> dateMap = getIdelMap(idelTimes[0],idelTimes[1]);
|
||||||
|
|
||||||
Map<String,List> busyMap = getBusyMap(dateMap);
|
Map<String,List> busyMap = getBusyMap(dateMap);
|
||||||
|
@ -267,8 +301,8 @@ public class ArtificerTimeServiceImpl extends ServiceImpl<ArtificerTimeDao, Arti
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result setArtificerAccept(Integer flag,Long userId){
|
public Result setArtificerAccept(Integer flag,Long artificerId){
|
||||||
Artificer artificer = artificerService.selectArtificerByUserId(userId);
|
Artificer artificer = artificerService.getById(artificerId);
|
||||||
Artificer artificer2 = new Artificer();
|
Artificer artificer2 = new Artificer();
|
||||||
artificer2.setAcceptOrders(flag);
|
artificer2.setAcceptOrders(flag);
|
||||||
artificer2.setArtificerId(artificer.getArtificerId());
|
artificer2.setArtificerId(artificer.getArtificerId());
|
||||||
|
|
|
@ -38,11 +38,16 @@ public class AppShipinquanController {
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation("获取视频数据列表")
|
@ApiOperation("获取视频数据列表")
|
||||||
public Result list(BlShipinquan entity, Integer page, Integer limit){
|
public Result list(Integer page, Integer limit, String userId,String gzrId,String longitude,String latitude){
|
||||||
if(page==null){
|
if(page==null){
|
||||||
page=1;
|
page=1;
|
||||||
limit=10;
|
limit=10;
|
||||||
}
|
}
|
||||||
|
BlShipinquan entity = new BlShipinquan();
|
||||||
|
entity.setUserId(userId);
|
||||||
|
entity.setLongitude(longitude);
|
||||||
|
entity.setLatitude(latitude);
|
||||||
|
entity.setGzrId(gzrId);
|
||||||
return service.findPage(page,limit,entity);
|
return service.findPage(page,limit,entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,9 @@ public class BlShipinquan implements Serializable {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String gzrId;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String artificerName;
|
private String artificerName;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
<select id="findPage" resultType="com.sqx.modules.shipinquan.entity.BlShipinquan">
|
<select id="findPage" resultType="com.sqx.modules.shipinquan.entity.BlShipinquan">
|
||||||
SELECT
|
SELECT
|
||||||
distinct
|
|
||||||
a.id,
|
a.id,
|
||||||
a.create_time,
|
a.create_time,
|
||||||
a.content,
|
a.content,
|
||||||
|
@ -34,23 +33,22 @@
|
||||||
b.artificer_id as create_by,
|
b.artificer_id as create_by,
|
||||||
b.artificer_name as artificer_name,
|
b.artificer_name as artificer_name,
|
||||||
b.artificer_img AS artificerImg,
|
b.artificer_img AS artificerImg,
|
||||||
if(c.id is null,0,1) as sfdz
|
(case when (select count(*) from bl_shipinquan_dianzan c where a.id = c.shipinquan_id and c.create_by = #{params.userId}) > 0 then 1 else 0 end) as sfdz
|
||||||
FROM bl_shipinquan a
|
FROM bl_shipinquan a
|
||||||
left join artificer b on a.create_by = b.user_id
|
left join artificer b on a.create_by = b.user_id
|
||||||
left join bl_shipinquan_dianzan c on a.id = c.shipinquan_id and c.create_by = #{params.createBy}
|
<if test="params.gzrId!=null and params.gzrId!=''">
|
||||||
<if test="params.userId!=null and params.userId!=''">and c.create_by = #{params.userId}</if>
|
inner join collect_artificer d on b.artificer_id = d.artificer_id and d.classify = 1 and d.user_id = #{params.gzrId}
|
||||||
left join collect_artificer d on b.artificer_id = d.artificer_id
|
</if>
|
||||||
<if test="params.userId!=null and params.userId!=''">and d.user_id = #{params.userId}</if>
|
|
||||||
<where>
|
<where>
|
||||||
<if test="params.createBy!=null and params.createBy!=''">
|
<if test="params.createBy!=null and params.createBy!=''">
|
||||||
and a.create_by = #{params.createBy}
|
and a.create_by = #{params.createBy}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
<if test="params.longitude!=null and params.longitude!='' and params.latitude!=null and params.latitude!=''">
|
<if test="params.longitude!=null and params.longitude!='' and params.latitude!=null and params.latitude!=''">
|
||||||
order by (st_distance (point (b.longitude, b.latitude),point(#{params.longitude},#{params.longitude}) ) *111195) asc,create_time desc
|
order by (st_distance (point (b.longitude, b.latitude),point(#{params.longitude},#{params.longitude}) ) *111195) asc,a.create_time desc
|
||||||
</if>
|
</if>
|
||||||
<if test="params.longitude==null or params.longitude=='' or params.latitude==null or params.latitude==''">
|
<if test="params.longitude==null or params.longitude=='' or params.latitude==null or params.latitude==''">
|
||||||
order by create_time desc
|
order by a.create_time desc
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue