|
@@ -64,6 +64,9 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
@Resource
|
|
@Resource
|
|
private TOrderService orderService;
|
|
private TOrderService orderService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private TSignService signService;
|
|
|
|
+
|
|
@Resource(name = "commonAsyncExecutor")
|
|
@Resource(name = "commonAsyncExecutor")
|
|
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
|
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
|
|
|
|
|
@@ -206,10 +209,20 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
if (js.getnStatus2() == null) {
|
|
if (js.getnStatus2() == null) {
|
|
throw new ServiceException("岗位状态不能为空");
|
|
throw new ServiceException("岗位状态不能为空");
|
|
}
|
|
}
|
|
|
|
+ TJs js2 = this.getById(js.getId());
|
|
|
|
+ TSign tSign = new TSign();
|
|
|
|
+
|
|
//上岗
|
|
//上岗
|
|
if (Objects.equals(js.getnStatus2(), JsStatusEnum.POST_ON_DUTY.getCode())) {
|
|
if (Objects.equals(js.getnStatus2(), JsStatusEnum.POST_ON_DUTY.getCode())) {
|
|
//岗位状态为1时,设置nStatus为1
|
|
//岗位状态为1时,设置nStatus为1
|
|
js.setnStatus(JsStatusEnum.JS_SERVICEABLE.getCode());
|
|
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());
|
|
|
|
+ tSign.setName(js2.getcName());
|
|
|
|
+ signService.save(tSign);
|
|
}
|
|
}
|
|
if (Objects.equals(js.getnStatus2(), JsStatusEnum.POST_NOT_ON_DUTY.getCode())) {
|
|
if (Objects.equals(js.getnStatus2(), JsStatusEnum.POST_NOT_ON_DUTY.getCode())) {
|
|
|
|
|
|
@@ -219,6 +232,13 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
throw new ServiceException("您有服务中的订单,不能下岗");
|
|
throw new ServiceException("您有服务中的订单,不能下岗");
|
|
}
|
|
}
|
|
js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
|
|
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);
|
|
}
|
|
}
|
|
return this.updateById(js);
|
|
return this.updateById(js);
|
|
}
|
|
}
|