|
@@ -0,0 +1,81 @@
|
|
|
+package com.gree.mall.manager.logic.worker;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
+import com.gree.mall.manager.bean.worker.WorkerElecConfirmVO;
|
|
|
+import com.gree.mall.manager.commonmapper.CommonMapper;
|
|
|
+import com.gree.mall.manager.enums.WorkerElecSingConfirmEnum;
|
|
|
+import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
+import com.gree.mall.manager.plus.entity.SysDictCompany;
|
|
|
+import com.gree.mall.manager.plus.entity.User;
|
|
|
+import com.gree.mall.manager.plus.entity.WorkerSignConfirm;
|
|
|
+import com.gree.mall.manager.plus.service.SysDictCompanyService;
|
|
|
+import com.gree.mall.manager.plus.service.UserService;
|
|
|
+import com.gree.mall.manager.plus.service.WorkerSignConfirmService;
|
|
|
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
|
|
|
+import com.gree.mall.manager.zfire.util.FieldUtils;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class WorkerElecConfirmLogic {
|
|
|
+
|
|
|
+ private final CommonLogic commonLogic;
|
|
|
+ private final CommonMapper commonMapper;
|
|
|
+ private final WorkerSignConfirmService workerSignConfirmService;
|
|
|
+ private final UserService userService;
|
|
|
+ private final SysDictCompanyService sysDictCompanyService;
|
|
|
+
|
|
|
+ public IPage<WorkerElecConfirmVO> list(ZfireParamBean zfireParamBean) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+// String status = null;
|
|
|
+// if (CollectionUtil.isNotEmpty(zfireParamBean.getParams())) {
|
|
|
+// List<QueryParamBean> newParam = new ArrayList<>();
|
|
|
+// for (QueryParamBean param : zfireParamBean.getParams()) {
|
|
|
+// if (!param.getParam().equals("a.status")) {
|
|
|
+// newParam.add(param);
|
|
|
+// }
|
|
|
+// status = param.getValue().toString();
|
|
|
+// }
|
|
|
+// }
|
|
|
+ FieldUtils.materialParam(zfireParamBean, WorkerElecConfirmVO.class, adminUser);
|
|
|
+
|
|
|
+ return commonMapper.workerSignConfirmPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public WorkerElecConfirmVO detail(String workerNumber, String belongCompanyCode) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+ WorkerElecConfirmVO vo = new WorkerElecConfirmVO();
|
|
|
+ final SysDictCompany company = sysDictCompanyService.lambdaQuery()
|
|
|
+ .eq(SysDictCompany::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .eq(SysDictCompany::getDictType, "BELONG_COMPANY")
|
|
|
+ .eq(SysDictCompany::getDictCode, belongCompanyCode)
|
|
|
+ .one();
|
|
|
+ final User user = userService.lambdaQuery()
|
|
|
+ .eq(User::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .eq(User::getWorkerNumber, workerNumber)
|
|
|
+ .one();
|
|
|
+ vo.setBelongCompany(company.getDictValue());
|
|
|
+ vo.setBelongCompanyCode(belongCompanyCode);
|
|
|
+ vo.setNickName(user.getNickName());
|
|
|
+ vo.setMobile(user.getMobile());
|
|
|
+ vo.setIdCard(user.getIdCard());
|
|
|
+
|
|
|
+ final WorkerSignConfirm confirm = workerSignConfirmService.lambdaQuery()
|
|
|
+ .eq(WorkerSignConfirm::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
|
|
|
+ .eq(WorkerSignConfirm::getWorkerNumber, workerNumber)
|
|
|
+ .eq(WorkerSignConfirm::getBelongCompanyCode, belongCompanyCode)
|
|
|
+ .one();
|
|
|
+ vo.setStatus(Objects.isNull(confirm) ? WorkerElecSingConfirmEnum.NO : WorkerElecSingConfirmEnum.YES);
|
|
|
+ vo.setCreateTime(Objects.isNull(confirm) ? null : confirm.getCreateTime());
|
|
|
+ vo.setUrl(Objects.isNull(confirm) ? null : confirm.getUrl());
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+}
|