|
@@ -140,15 +140,16 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
|
|
|
|
return update;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public void jsNotification(TJs js) {
|
|
|
|
|
|
cn.hutool.json.JSONObject param = JSONUtil.createObj();
|
|
|
//是否审核通过
|
|
|
|
|
|
- if(JsStatusEnum.JS_PASS.getCode().equals(js.getnTong())){
|
|
|
+ if (JsStatusEnum.JS_PASS.getCode().equals(js.getnTong())) {
|
|
|
param.set("const1", JSONUtil.createObj().set("value", "审核通过可以接单"));
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
param.set("const1", JSONUtil.createObj().set("value", "审核驳回请重新提交"));
|
|
|
}
|
|
|
|
|
@@ -173,7 +174,7 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
|
// JSONObject jsonObject = new JSONObject(js.getcAddress());
|
|
|
// Object latitude = jsonObject.get("latitude");
|
|
|
// Object longitude = jsonObject.get("longitude");
|
|
|
- locationUtil.geoAdd(LocationUtil.GEO_KEY,js.getcOpenId(), Double.parseDouble(js.getLongitude().toString()), Double.parseDouble(js.getLatitude().toString()));
|
|
|
+ locationUtil.geoAdd(LocationUtil.GEO_KEY, js.getcOpenId(), Double.parseDouble(js.getLongitude().toString()), Double.parseDouble(js.getLatitude().toString()));
|
|
|
LambdaQueryWrapper<TJs> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
objectLambdaQueryWrapper.eq(TJs::getcOpenId, js.getcOpenId());
|
|
|
return this.update(js, objectLambdaQueryWrapper);
|
|
@@ -193,13 +194,14 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
|
//订单号
|
|
|
param.set("character_string9", JSONUtil.createObj().set("value", "23010000010101"));
|
|
|
//点话
|
|
|
- param.set("phone_number14",JSONUtil.createObj().set("value", "18360233903"));
|
|
|
- param.set("thing18",JSONUtil.createObj().set("value", "李四"));
|
|
|
- param.set("time6",JSONUtil.createObj().set("value", "2022年11月11日 22:22"));
|
|
|
- param.set("thing27",JSONUtil.createObj().set("value", "湖南长沙岳麓"));
|
|
|
+ param.set("phone_number14", JSONUtil.createObj().set("value", "18360233903"));
|
|
|
+ param.set("thing18", JSONUtil.createObj().set("value", "李四"));
|
|
|
+ param.set("time6", JSONUtil.createObj().set("value", "2022年11月11日 22:22"));
|
|
|
+ param.set("thing27", JSONUtil.createObj().set("value", "湖南长沙岳麓"));
|
|
|
// weChatUtil.notification(openId, param);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public boolean upPost(TJs js) {
|
|
|
|
|
@@ -217,7 +219,6 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
|
//岗位状态为1时,设置nStatus为1
|
|
|
js.setnStatus(JsStatusEnum.JS_SERVICEABLE.getCode());
|
|
|
//记录签到信息
|
|
|
- tSign.setDutyStatus(JsStatusEnum.POST_ON_DUTY.getCode());
|
|
|
tSign.setSingTime(new Date());
|
|
|
tSign.setOpenId(js2.getcOpenId());
|
|
|
tSign.setJsId(js2.getId());
|
|
@@ -232,17 +233,38 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
|
throw new ServiceException("您有服务中的订单,不能下岗");
|
|
|
}
|
|
|
js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
|
|
|
- //记录签退信息
|
|
|
- tSign.setDutyStatus(JsStatusEnum.POST_NOT_ON_DUTY.getCode());
|
|
|
- tSign.setSingTime(new Date());
|
|
|
- tSign.setOpenId(js2.getcOpenId());
|
|
|
- tSign.setJsId(js2.getId());
|
|
|
- tSign.setName(js2.getcName());
|
|
|
- signService.save(tSign);
|
|
|
+ LambdaQueryWrapper<TSign> signLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ signLambdaQueryWrapper.eq(TSign::getJsId, js.getId()).isNull(TSign::getLayoffTime).orderByAsc(TSign::getSingTime).last("LIMIT 1");
|
|
|
+ TSign singn = signService.getOne(signLambdaQueryWrapper);
|
|
|
+
|
|
|
+ if (null != singn) {
|
|
|
+ singn.setLayoffTime(new Date());
|
|
|
+ Long time = getaTime(singn);
|
|
|
+ singn.setOnlineTime(time.intValue());
|
|
|
+ signService.updateById(singn);
|
|
|
+ } else {
|
|
|
+ tSign.setSingTime(DateTimeUtils.getStartDate(new Date()));
|
|
|
+ tSign.setLayoffTime(new Date());
|
|
|
+ tSign.setOpenId(js2.getcOpenId());
|
|
|
+ tSign.setJsId(js2.getId());
|
|
|
+ tSign.setName(js2.getcName());
|
|
|
+ Long time = getaTime(tSign);
|
|
|
+ tSign.setOnlineTime(time.intValue());
|
|
|
+ signService.save(tSign);
|
|
|
+ }
|
|
|
}
|
|
|
return this.updateById(js);
|
|
|
}
|
|
|
|
|
|
+ private Long getaTime(TSign tSign) {
|
|
|
+ Long layoff = DateTimeUtils.dateToStamp(tSign.getLayoffTime());
|
|
|
+ Long sing = DateTimeUtils.dateToStamp(tSign.getSingTime());
|
|
|
+ Long time = layoff - sing;
|
|
|
+ time = time / 1000;
|
|
|
+ time = time / 60;
|
|
|
+ return time;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public boolean block(TJs js) {
|
|
|
if (StringUtils.isBlank(js.getId())) {
|
|
@@ -268,6 +290,7 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
|
}
|
|
|
return this.updateById(js);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public TJs getByJsId(String jsId, String openId) {
|
|
|
if (jsId == null || jsId.trim().isEmpty()) {
|