|
@@ -222,6 +222,32 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
|
|
|
}
|
|
|
return this.updateById(js);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean block(TJs js) {
|
|
|
+ if (StringUtils.isBlank(js.getId())) {
|
|
|
+ throw new ServiceException("技师ID不能为空");
|
|
|
+ }
|
|
|
+ if (js.getnTong() == null) {
|
|
|
+ throw new ServiceException("拉黑状态不能为空");
|
|
|
+ }
|
|
|
+ //恢复
|
|
|
+ if (Objects.equals(js.getnTong(), JsStatusEnum.JS_NOT_PASS.getCode())) {
|
|
|
+ //岗位状态为1时,设置nStatus为1
|
|
|
+ js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
|
|
|
+ }
|
|
|
+ if (Objects.equals(js.getnTong(), JsStatusEnum.BLOCKED.getCode())) {
|
|
|
+
|
|
|
+ //判断该技师是否有服务中的订单
|
|
|
+ TJs js1 = this.getById(js.getId());
|
|
|
+ if (js1.getnStatus().equals(JsStatusEnum.JS_SERVICE.getCode())) {
|
|
|
+ throw new ServiceException("有服务中的订单,暂时不能拉黑");
|
|
|
+ }
|
|
|
+ js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
|
|
|
+ js.setnStatus2(JsStatusEnum.POST_NOT_ON_DUTY.getCode());
|
|
|
+ }
|
|
|
+ return this.updateById(js);
|
|
|
+ }
|
|
|
@Override
|
|
|
public TJs getByJsId(String jsId, String openId) {
|
|
|
if (jsId == null || jsId.trim().isEmpty()) {
|