出行调整定时
This commit is contained in:
parent
327a2179aa
commit
a7f93f315b
|
@ -70,4 +70,7 @@ public interface ArtificerDao extends BaseMapper<Artificer> {
|
||||||
void insertJfDetail(Long artificerId, String artificerName, Integer type, BigDecimal integral,String remarks);
|
void insertJfDetail(Long artificerId, String artificerName, Integer type, BigDecimal integral,String remarks);
|
||||||
|
|
||||||
int queryInServiceCount();
|
int queryInServiceCount();
|
||||||
|
|
||||||
|
List<Artificer> getArtificerAdjustList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,8 @@ import com.sqx.modules.bl.userZxsc.entity.BlUserZxsc;
|
||||||
import com.sqx.modules.common.dao.CommonInfoDao;
|
import com.sqx.modules.common.dao.CommonInfoDao;
|
||||||
import com.sqx.modules.common.entity.CommonInfo;
|
import com.sqx.modules.common.entity.CommonInfo;
|
||||||
import com.sqx.modules.task.service.AllTaskSercice;
|
import com.sqx.modules.task.service.AllTaskSercice;
|
||||||
|
import com.sqx.modules.traveladjust.entity.TravelAdjust;
|
||||||
|
import com.sqx.modules.traveladjust.service.TravelAdjustService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -69,6 +71,9 @@ public class AllTaskServiceImpl implements AllTaskSercice {
|
||||||
private ArtificerTimeDao artificerTimeDao;
|
private ArtificerTimeDao artificerTimeDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ArtificerTimeIdelDao artificerTimeIdelDao;
|
private ArtificerTimeIdelDao artificerTimeIdelDao;
|
||||||
|
@Autowired
|
||||||
|
private TravelAdjustService travelAdjustService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算技师升级规则 每天半夜1点执行,预留12点到01点之间的计算间隔,用于触发其他计算逻辑
|
* 计算技师升级规则 每天半夜1点执行,预留12点到01点之间的计算间隔,用于触发其他计算逻辑
|
||||||
|
@ -510,4 +515,29 @@ public class AllTaskServiceImpl implements AllTaskSercice {
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出行方式自动调整 每30分钟
|
||||||
|
*/
|
||||||
|
@Scheduled(cron = "0 1/30 * * * ?")
|
||||||
|
public void travelAdjust() {
|
||||||
|
log.info("----------------出行方式自动调整 定时任务-------------");
|
||||||
|
//当前时间
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
String businessTime = DateUtils.format(calendar.getTime(), "HH:mm:ss");
|
||||||
|
TravelAdjust travelAdjust = travelAdjustService.getTravelType(businessTime);
|
||||||
|
if(travelAdjust!=null){
|
||||||
|
Integer cxfs = travelAdjust.getTravelType1();//1公交 2出租 3免费
|
||||||
|
BigDecimal mfgls = travelAdjust.getTravelNum1();//免费公里数
|
||||||
|
//获取技师是否可调整出行方式为否的数据
|
||||||
|
List<Artificer> adjustList = artificerDao.getArtificerAdjustList();
|
||||||
|
for (Artificer artificer : adjustList) {
|
||||||
|
artificer.setTripWay(cxfs);
|
||||||
|
artificer.setTripWayNum(mfgls);
|
||||||
|
artificerDao.updateById(artificer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.info("----------------完成出行方式自动调整 定时任务-------------");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -500,4 +500,10 @@
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="getArtificerAdjustList" resultType="com.sqx.modules.artificer.entity.Artificer">
|
||||||
|
select a.*
|
||||||
|
from artificer a
|
||||||
|
where adjust_way = 2
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue