TJsServiceImpl.java 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. package com.ylx.massage.service.impl;
  2. import cn.hutool.core.collection.CollectionUtil;
  3. import cn.hutool.json.JSONException;
  4. import cn.hutool.json.JSONUtil;
  5. import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  6. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7. import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  8. import com.ylx.common.config.WechatAccountConfig;
  9. import com.ylx.common.constant.MassageConstants;
  10. import com.ylx.common.exception.ServiceException;
  11. import com.ylx.common.utils.StringUtils;
  12. import com.ylx.massage.domain.*;
  13. import com.ylx.massage.domain.vo.TJsVo;
  14. import com.ylx.massage.enums.JsStatusEnum;
  15. import com.ylx.massage.mapper.TJsMapper;
  16. import com.ylx.massage.service.*;
  17. import com.ylx.massage.utils.DateTimeUtils;
  18. import com.ylx.massage.utils.LocationUtil;
  19. import com.ylx.massage.utils.VirtualTechnicianNicknameGenerator;
  20. import com.ylx.massage.utils.WeChatUtil;
  21. import com.ylx.order.service.TOrderService;
  22. import lombok.extern.slf4j.Slf4j;
  23. import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
  24. import org.springframework.stereotype.Service;
  25. import org.springframework.transaction.annotation.Transactional;
  26. import javax.annotation.Resource;
  27. import java.time.LocalDateTime;
  28. import java.util.*;
  29. import java.util.stream.Collectors;
  30. /**
  31. * 技师表 服务实现类
  32. */
  33. @Service
  34. @Slf4j
  35. public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsService {
  36. @Resource
  37. private TJsMapper mapper;
  38. @Resource
  39. private WechatAccountConfig wxPayProperties;
  40. @Resource
  41. private LocationUtil locationUtil;
  42. @Resource
  43. private TCollectService collectService;
  44. @Resource
  45. private TXiangmuService xiangmuService;
  46. @Resource
  47. private TCommentService commentService;
  48. @Resource
  49. private TWxUserService wxUserService;
  50. @Resource
  51. private WeChatUtil weChatUtil;
  52. @Resource
  53. private TOrderService orderService;
  54. @Resource
  55. private TSignService signService;
  56. @Resource(name = "commonAsyncExecutor")
  57. private ThreadPoolTaskExecutor threadPoolTaskExecutor;
  58. @Resource
  59. private VirtualTechnicianNicknameGenerator nicknameGenerator;
  60. @Override
  61. public Page<TJs> getAll(Page<TJs> page, TJsVo param) {
  62. return mapper.getAll(page, param);
  63. }
  64. @Override
  65. public boolean addJs(TJs js) {
  66. LambdaQueryWrapper<TJs> queryWrapper = new LambdaQueryWrapper<>();
  67. queryWrapper.eq(TJs::getcOpenId, js.getcOpenId());
  68. TJs cjs = this.getOne(queryWrapper);
  69. if (cjs != null) {
  70. throw new ServiceException("请勿重复申请");
  71. }
  72. // cacheAddress(js);
  73. initialization(js);
  74. return this.save(js);
  75. }
  76. private void cacheAddress(TJs js) {
  77. if (StringUtils.isBlank(js.getcPhone())) {
  78. throw new ServiceException("手机号不能为空");
  79. }
  80. if (StringUtils.isBlank(js.getName())) {
  81. throw new ServiceException("地址不能为空");
  82. }
  83. if (StringUtils.isNotBlank(js.getId())) {
  84. TJs oldJs = this.getById(js.getId());
  85. if (oldJs.getnTong().equals(JsStatusEnum.JS_RETURN.getCode())) {
  86. js.setnTong(JsStatusEnum.JS_NOT_PASS.getCode());
  87. }
  88. }
  89. if (StringUtils.isNotBlank(js.getName())) {
  90. this.updateLocation(js);
  91. }
  92. // log.info("js:{}", js);
  93. // JSONObject jsonObject = new JSONObject(js.getcAddress());
  94. // Object latitude = jsonObject.get("latitude");
  95. // Object longitude = jsonObject.get("longitude");
  96. // locationUtil.geoAdd(LocationUtil.GEO_KEY,js.getcOpenId(), Double.parseDouble(js.getLongitude().toString()), Double.parseDouble(js.getLatitude().toString()));
  97. }
  98. @Override
  99. public boolean wxUpdateJs(TJs js) {
  100. cacheAddress(js);
  101. return this.updateById(js);
  102. }
  103. @Override
  104. @Transactional(rollbackFor = Exception.class)
  105. public boolean auditing(TJs js) {
  106. TJs js1 = this.getById(js.getId());
  107. LambdaQueryWrapper<TJs> jsLambdaQueryWrapper = new LambdaQueryWrapper<>();
  108. jsLambdaQueryWrapper.eq(TJs::getId, js.getId()).eq(TJs::getnTong, JsStatusEnum.JS_NOT_PASS.getCode());
  109. js.setnTong(JsStatusEnum.JS_PASS.getCode());
  110. js.setnB2(1);
  111. js.setcPhone(js1.getcPhone());
  112. js.setcTime(new Date());
  113. LambdaQueryWrapper<TWxUser> wxLambdaQueryWrapper = new LambdaQueryWrapper<>();
  114. wxLambdaQueryWrapper.eq(TWxUser::getcOpenid, js1.getcOpenId());
  115. TWxUser tWxUser = new TWxUser();
  116. //角色状态修改
  117. tWxUser.setRole(1);
  118. wxUserService.update(tWxUser, wxLambdaQueryWrapper);
  119. //修改审核状态
  120. boolean update = this.update(js, jsLambdaQueryWrapper);
  121. //修改新技师标识
  122. /* js.setcOpenId(js1.getcOpenId());
  123. // 发送审核结果通知
  124. this.jsNotification(js);*/
  125. return update;
  126. }
  127. @Override
  128. public void jsNotification(TJs js) {
  129. try {
  130. cn.hutool.json.JSONObject param = JSONUtil.createObj();
  131. //是否审核通过
  132. if (JsStatusEnum.JS_PASS.getCode().equals(js.getnTong())) {
  133. param.set("const1", JSONUtil.createObj().set("value", "审核通过可以接单"));
  134. } else {
  135. param.set("const1", JSONUtil.createObj().set("value", "审核驳回请重新提交"));
  136. }
  137. //审核时间
  138. param.set("time2", JSONUtil.createObj().set("value", DateTimeUtils.formatDate(new Date(), DateTimeUtils.DATE_NUMBER_YEAR_MONTH_FORMAT)));
  139. //账号
  140. param.set("character_string3", JSONUtil.createObj().set("value", js.getcPhone()));
  141. //
  142. weChatUtil.notification(js.getcOpenId(), wxPayProperties.getTemplateId2(), param);
  143. } catch (JSONException e) {
  144. e.printStackTrace();
  145. throw new RuntimeException(e);
  146. }
  147. }
  148. @Override
  149. public boolean updateLocation(TJs js) {
  150. if (StringUtils.isBlank(js.getId())) {
  151. throw new ServiceException("ID不能为空");
  152. }
  153. if (StringUtils.isBlank(js.getName())) {
  154. throw new ServiceException("地址不能为空");
  155. }
  156. // JSONObject jsonObject = new JSONObject(js.getcAddress());
  157. // Object latitude = jsonObject.get("latitude");
  158. // Object longitude = jsonObject.get("longitude");
  159. locationUtil.geoAdd(LocationUtil.GEO_KEY, js.getcPhone(), Double.parseDouble(js.getLongitude().toString()), Double.parseDouble(js.getLatitude().toString()));
  160. return this.updateById(js);
  161. }
  162. @Override
  163. public void newOrderNotification(String openId) {
  164. // 订单号 23010000010101
  165. // 用户电话 15055556666
  166. // 用户名称 李四
  167. // 时间 2022年11月11日22:22
  168. // 服务地址 湖南长沙岳麓
  169. /*cn.hutool.json.JSONObject param = JSONUtil.createObj();
  170. //订单号
  171. param.set("character_string9", JSONUtil.createObj().set("value", "23010000010101"));
  172. //点话
  173. param.set("phone_number14", JSONUtil.createObj().set("value", "18360233903"));
  174. param.set("thing18", JSONUtil.createObj().set("value", "李四"));
  175. param.set("time6", JSONUtil.createObj().set("value", "2022年11月11日 22:22"));
  176. param.set("thing27", JSONUtil.createObj().set("value", "湖南长沙岳麓"));*/
  177. cn.hutool.json.JSONObject param = JSONUtil.createObj();
  178. /**
  179. * 接单成功通知
  180. */
  181. //设置订单号
  182. param.set("character_string1", JSONUtil.createObj().set("value", "123456"));
  183. //设置项目
  184. param.set("thing4", JSONUtil.createObj().set("value", "按摩"));
  185. //商家名称
  186. param.set("thing9", JSONUtil.createObj().set("value", "李强"));
  187. //联系电话
  188. param.set("phone_number5", JSONUtil.createObj().set("value", "15296619636"));
  189. weChatUtil.notification(openId, wxPayProperties.getUserTemplate1(), param);
  190. }
  191. @Override
  192. public boolean upPost(TJs js) {
  193. if (StringUtils.isBlank(js.getId())) {
  194. throw new ServiceException("技师ID不能为空");
  195. }
  196. if (js.getnStatus2() == null) {
  197. throw new ServiceException("岗位状态不能为空");
  198. }
  199. TJs js2 = this.getById(js.getId());
  200. TSign tSign = new TSign();
  201. //上岗
  202. if (Objects.equals(js.getnStatus2(), JsStatusEnum.POST_ON_DUTY.getCode())) {
  203. //岗位状态为1时,设置nStatus为1
  204. js.setnStatus(JsStatusEnum.JS_SERVICEABLE.getCode());
  205. //记录签到信息
  206. tSign.setSingTime(new Date());
  207. tSign.setOpenId(js2.getcOpenId());
  208. tSign.setJsId(js2.getId());
  209. tSign.setName(js2.getcName());
  210. tSign.setDeptId(js2.getDeptId());
  211. tSign.setDeptName(js2.getCity());
  212. signService.save(tSign);
  213. }
  214. if (Objects.equals(js.getnStatus2(), JsStatusEnum.POST_NOT_ON_DUTY.getCode())) {
  215. //判断该技师是否有服务中的订单
  216. TJs js1 = this.getById(js.getId());
  217. if (js1.getnStatus().equals(JsStatusEnum.JS_SERVICE.getCode())) {
  218. throw new ServiceException("您有服务中的订单,不能下岗");
  219. }
  220. js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
  221. LambdaQueryWrapper<TSign> signLambdaQueryWrapper = new LambdaQueryWrapper<>();
  222. signLambdaQueryWrapper.eq(TSign::getJsId, js.getId()).isNull(TSign::getLayoffTime).orderByAsc(TSign::getSingTime).last("LIMIT 1");
  223. TSign singn = signService.getOne(signLambdaQueryWrapper);
  224. if (null != singn) {
  225. singn.setLayoffTime(new Date());
  226. Long time = getaTime(singn);
  227. singn.setOnlineTime(time.intValue());
  228. signService.updateById(singn);
  229. }
  230. // else {
  231. // tSign.setSingTime(DateTimeUtils.getStartDate(new Date()));
  232. // tSign.setLayoffTime(new Date());
  233. // tSign.setOpenId(js2.getcOpenId());
  234. // tSign.setJsId(js2.getId());
  235. // tSign.setName(js2.getcName());
  236. // Long time = getaTime(tSign);
  237. // tSign.setDeptId(js2.getDeptId());
  238. // tSign.setDeptName(js2.getCity());
  239. // tSign.setOnlineTime(time.intValue());
  240. // signService.save(tSign);
  241. // }
  242. }
  243. return this.updateById(js);
  244. }
  245. private Long getaTime(TSign tSign) {
  246. Long layoff = DateTimeUtils.dateToStamp(tSign.getLayoffTime());
  247. Long sing = DateTimeUtils.dateToStamp(tSign.getSingTime());
  248. Long time = layoff - sing;
  249. time = time / 1000;
  250. time = time / 60;
  251. return time;
  252. }
  253. @Override
  254. public boolean block(TJs js) {
  255. if (StringUtils.isBlank(js.getId())) {
  256. throw new ServiceException("技师ID不能为空");
  257. }
  258. if (js.getnTong() == null) {
  259. throw new ServiceException("拉黑状态不能为空");
  260. }
  261. //恢复
  262. if (Objects.equals(js.getnTong(), JsStatusEnum.JS_NOT_PASS.getCode())) {
  263. //岗位状态为1时,设置nStatus为1
  264. js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
  265. }
  266. if (Objects.equals(js.getnTong(), JsStatusEnum.BLOCKED.getCode())) {
  267. //判断该技师是否有服务中的订单
  268. TJs js1 = this.getById(js.getId());
  269. if (js1.getnStatus().equals(JsStatusEnum.JS_SERVICE.getCode())) {
  270. throw new ServiceException("有服务中的订单,暂时不能拉黑");
  271. }
  272. js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
  273. js.setnStatus2(JsStatusEnum.POST_NOT_ON_DUTY.getCode());
  274. }
  275. return this.updateById(js);
  276. }
  277. @Override
  278. @Transactional(rollbackFor = Exception.class)
  279. public boolean pcAddJs(TJs js) {
  280. /*if (js.getCity() == null) {
  281. throw new ServiceException("所在城市不能为空");
  282. }*/
  283. //判断生活照图片列表不能为空
  284. if (js.getcImgList() == null || js.getcImgList().isEmpty()) {
  285. throw new ServiceException("生活照图片列表不能为空");
  286. }
  287. //判断身份证图片列表不能为空
  288. if (js.getcSfzImg() == null || js.getcSfzImg().isEmpty()) {
  289. throw new ServiceException("身份证图片列表不能为空");
  290. }
  291. //判断虚拟订单数量不能为空
  292. if (js.getVirtualOrderNumber() == null) {
  293. throw new ServiceException("虚拟订单数量不能为空");
  294. }
  295. if (js.getVirtualTechNumber() == null) {
  296. // 默认值为10
  297. js.setVirtualTechNumber(10);
  298. }
  299. // 验证虚拟技师数量
  300. Integer virtualTechNumber = js.getVirtualTechNumber();
  301. if (virtualTechNumber < 0) {
  302. throw new ServiceException("虚拟技师数量不能为负数");
  303. }
  304. // 0-真实技师
  305. js.setTechType(0);
  306. //设置性别,默认:女
  307. js.setnSex(0);
  308. //设置服务状态,默认:可服务
  309. js.setnStatus(JsStatusEnum.JS_SERVICEABLE.getCode());
  310. // 上岗状态:默认为未上岗
  311. js.setnStatus2(JsStatusEnum.POST_NOT_ON_DUTY.getCode());
  312. // 审核状态:默认为待审核
  313. js.setnTong(JsStatusEnum.JS_NOT_PASS.getCode());
  314. js.setDtCreateTime(LocalDateTime.now());
  315. this.save(js);
  316. // 如果需要生成虚拟技师
  317. if (virtualTechNumber > 0) {
  318. log.info("开始为真实技师[{}]生成{}个虚拟技师", js.getcName(), virtualTechNumber);
  319. generateVirtualTechnicians(js, virtualTechNumber);
  320. }
  321. String token = weChatUtil.getToken();
  322. log.info("获取到的token: {}", token);
  323. //获取二维码ticket
  324. Map<?, ?> jsTicket = weChatUtil.getJsTicket(token, js.getId());
  325. log.info("获取到的jsTicket: {}", jsTicket);
  326. js.setTicket(jsTicket.get("ticket").toString());
  327. return this.updateById(js);
  328. }
  329. /**
  330. * 批量生成虚拟技师
  331. * <p>
  332. * 业务规则:
  333. * <ul>
  334. * <li>虚拟技师类型为 techType = 1</li>
  335. * <li>除昵称外,其他信息与真实技师完全一致</li>
  336. * <li>昵称随机生成(2-3个汉字,偏女性化,全表唯一)</li>
  337. * <li>虚拟技师不需要手机号、OpenID等敏感信息</li>
  338. * </ul>
  339. * </p>
  340. *
  341. * @param realTechnician 真实技师信息
  342. * @param virtualTechNumber 需要生成的虚拟技师数量
  343. */
  344. private void generateVirtualTechnicians(TJs realTechnician, Integer virtualTechNumber) {
  345. try {
  346. // 批量生成唯一昵称
  347. List<String> nicknames = nicknameGenerator.batchGenerateUniqueNicknames(virtualTechNumber);
  348. log.info("成功生成{}个唯一昵称", nicknames.size());
  349. // 批量创建虚拟技师对象
  350. List<TJs> virtualTechnicians = new ArrayList<>(virtualTechNumber);
  351. LocalDateTime now = LocalDateTime.now();
  352. for (String nickname : nicknames) {
  353. TJs virtualJs = new TJs();
  354. // 复制真实技师的所有字段(除ID、昵称、技师类型外)
  355. virtualJs.setcNickName(nickname); // 随机生成的昵称
  356. virtualJs.setTechType(1); // 1-虚拟技师
  357. virtualJs.setcName(realTechnician.getcName()); // 真实姓名(保持一致)
  358. virtualJs.setcPortrait(realTechnician.getcPortrait()); // 头像
  359. virtualJs.setcPhone(realTechnician.getcPhone());
  360. virtualJs.setcOpenId(realTechnician.getcOpenId());
  361. virtualJs.setcAddress(realTechnician.getcAddress()); // 地址
  362. virtualJs.setnSex(realTechnician.getnSex()); // 性别
  363. virtualJs.setcImgList(realTechnician.getcImgList()); // 生活照列表
  364. virtualJs.setcSfzImg(realTechnician.getcSfzImg()); // 身份证图片
  365. virtualJs.setcVideo(realTechnician.getcVideo()); // 视频介绍
  366. virtualJs.setcBhList(realTechnician.getcBhList()); // 可预约项目列表
  367. virtualJs.setHealthCertificate(realTechnician.getHealthCertificate()); // 健康证
  368. virtualJs.setBusinessLicense(realTechnician.getBusinessLicense()); // 营业执照
  369. virtualJs.setCertification(realTechnician.getCertification()); // 资格证
  370. virtualJs.setNoCrime(realTechnician.getNoCrime()); // 无犯罪记录
  371. virtualJs.setDeptId(realTechnician.getDeptId()); // 部门ID
  372. virtualJs.setDaytimeMileage(realTechnician.getDaytimeMileage()); // 白天免车费公里数
  373. virtualJs.setNigthMileage(realTechnician.getNigthMileage()); // 夜间免车费公里数
  374. virtualJs.setcJianjie(realTechnician.getcJianjie()); // 个人简介
  375. virtualJs.setnStar(MassageConstants.INTEGER_FIVE); // 评分
  376. virtualJs.setnBili(realTechnician.getnBili()); // 佣金比例
  377. virtualJs.setLongitude(realTechnician.getLongitude()); // 经度
  378. virtualJs.setLatitude(realTechnician.getLatitude()); // 纬度
  379. // 服务状态,默认:可服务
  380. virtualJs.setnStatus(JsStatusEnum.JS_SERVICEABLE.getCode());
  381. virtualJs.setnStatus2(JsStatusEnum.POST_NOT_ON_DUTY.getCode()); // 上岗状态
  382. virtualJs.setnTong(JsStatusEnum.JS_NOT_PASS.getCode()); // 审核状态
  383. virtualJs.setnB1(realTechnician.getnB1());
  384. virtualJs.setnB2(realTechnician.getnB2());
  385. virtualJs.setnB3(realTechnician.getnB3());
  386. virtualJs.setDtCreateTime(now); // 创建时间
  387. virtualJs.setVirtualOrderNumber(realTechnician.getVirtualOrderNumber()); // 虚拟订单数量
  388. virtualJs.setVirtualTechNumber(0); // 虚拟技师数量(虚拟技师不再生成虚拟技师)
  389. virtualJs.setRecording(realTechnician.getRecording()); // 录音
  390. virtualJs.setVideoRecording(realTechnician.getVideoRecording()); // 录像
  391. virtualJs.setCommitment(realTechnician.getCommitment()); // 承诺书
  392. virtualJs.setCity(realTechnician.getCity()); // 所在城市
  393. virtualJs.setJsGrade(realTechnician.getJsGrade()); // 技师等级
  394. virtualTechnicians.add(virtualJs);
  395. }
  396. // 批量保存虚拟技师
  397. boolean saveResult = this.saveBatch(virtualTechnicians);
  398. if (saveResult) {
  399. log.info("成功批量保存{}个虚拟技师", virtualTechnicians.size());
  400. } else {
  401. throw new ServiceException("批量保存虚拟技师失败");
  402. }
  403. } catch (Exception e) {
  404. log.error("生成虚拟技师失败", e);
  405. throw new ServiceException("生成虚拟技师失败:" + e.getMessage());
  406. } finally {
  407. // 清理昵称缓存,释放内存
  408. nicknameGenerator.clearCache();
  409. }
  410. }
  411. @Override
  412. public TJs getByJsId(String jsId, String openId) {
  413. if (jsId == null || jsId.trim().isEmpty()) {
  414. // 处理空或空白的jsId
  415. throw new ServiceException("Id为空");
  416. }
  417. TJs js = this.getById(jsId);
  418. if (js == null) {
  419. // 处理getById返回null的情况
  420. return null; // 或者返回一个新的TJs实例,具体看业务需求
  421. }
  422. if (StringUtils.isBlank(js.getcBhList())) {
  423. // 处理js.getcBhList()返回null或空列表的情况
  424. js.setProjects(new ArrayList<>()); // 设置空列表,避免后续调用空指针
  425. return js;
  426. }
  427. //查询项目
  428. List<String> projectIds = Arrays.stream(js.getcBhList().split(",")).collect(Collectors.toList());
  429. LambdaQueryWrapper<TXiangmu> xiangmuLambdaQueryWrapper = new LambdaQueryWrapper<>();
  430. xiangmuLambdaQueryWrapper.in(TXiangmu::getcId, projectIds).orderByAsc(TXiangmu::getdPrice);
  431. List<TXiangmu> projects = xiangmuService.list(xiangmuLambdaQueryWrapper);
  432. js.setProjects(projects);
  433. //查询评论
  434. LambdaQueryWrapper<TComment> commentLambdaQueryWrapper = new LambdaQueryWrapper<>();
  435. commentLambdaQueryWrapper.eq(TComment::getcJsid, jsId);
  436. List<TComment> list = commentService.list(commentLambdaQueryWrapper);
  437. if (CollectionUtil.isNotEmpty(list)) {
  438. js.setComments(list);
  439. }
  440. //是否收藏
  441. LambdaQueryWrapper<TCollect> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
  442. objectLambdaQueryWrapper.eq(TCollect::getcJsId, jsId).eq(TCollect::getcWxOpenId, openId);
  443. TCollect collect = collectService.getOne(objectLambdaQueryWrapper);
  444. if (collect != null) {
  445. js.setIsCollection(true);
  446. } else {
  447. js.setIsCollection(false);
  448. }
  449. return js;
  450. }
  451. private static void initialization(TJs js) {
  452. // 评分默认最高 5
  453. js.setnStar(MassageConstants.INTEGER_FIVE);
  454. // 已服务数量 0
  455. js.setnNum(MassageConstants.INTEGER_ZERO);
  456. // 佣金比例 10
  457. js.setnBili(MassageConstants.INTEGER_TEN);
  458. // 服务状态
  459. js.setnStatus(JsStatusEnum.JS_NO_SERVICE.getCode());
  460. // 上岗状态
  461. js.setnStatus2(JsStatusEnum.POST_NOT_ON_DUTY.getCode());
  462. // 审核状态
  463. js.setnTong(JsStatusEnum.JS_NOT_PASS.getCode());
  464. js.setnB1(MassageConstants.INTEGER_ZERO);
  465. js.setnB2(MassageConstants.INTEGER_ZERO);
  466. js.setnB3(MassageConstants.INTEGER_ZERO);
  467. js.setTechType(MassageConstants.INTEGER_ZERO);
  468. js.setDtCreateTime(LocalDateTime.now());
  469. }
  470. }