|
@@ -0,0 +1,68 @@
|
|
|
+package com.gree.mall.manager.logic.contract;
|
|
|
+
|
|
|
+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.contract.WebsitContractSignRecordBean;
|
|
|
+import com.gree.mall.manager.bean.contract.WebsitContractSignVO;
|
|
|
+import com.gree.mall.manager.commonmapper.CommonMapper;
|
|
|
+import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
+import com.gree.mall.manager.plus.entity.AdminWebsit;
|
|
|
+import com.gree.mall.manager.plus.entity.WebsitContractSignItem;
|
|
|
+import com.gree.mall.manager.plus.entity.WebsitContractSignRecord;
|
|
|
+import com.gree.mall.manager.plus.service.AdminWebsitService;
|
|
|
+import com.gree.mall.manager.plus.service.WebsitContractSignItemService;
|
|
|
+import com.gree.mall.manager.plus.service.WebsitContractSignRecordService;
|
|
|
+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.beans.BeanUtils;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
+@Service
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class WebsitContractSignLogic {
|
|
|
+
|
|
|
+ private final CommonLogic commonLogic;
|
|
|
+ private final CommonMapper commonMapper;
|
|
|
+ private final AdminWebsitService adminWebsitService;
|
|
|
+ private final WebsitContractSignRecordService websitContractSignRecordService;
|
|
|
+ private final WebsitContractSignItemService websitContractSignItemService;
|
|
|
+
|
|
|
+ public IPage<WebsitContractSignVO> list(ZfireParamBean zfireParamBean) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+ FieldUtils.supplyParam(zfireParamBean, WebsitContractSignVO.class, adminUser);
|
|
|
+ String websitId = null;
|
|
|
+ if (adminUser.getType().equals(0) && adminUser.getAdminWebsitIds().size() == 1) {
|
|
|
+ final AdminWebsit websit = adminWebsitService.lambdaQuery()
|
|
|
+ .eq(AdminWebsit::getCompanyWechatId, adminUser.getCompanyWechatId())
|
|
|
+ .eq(AdminWebsit::getWebsitId, adminUser.getAdminWebsitIds().get(0))
|
|
|
+ .one();
|
|
|
+ if (websit.getLevel() == 2) {
|
|
|
+ websitId = websit.getWebsitId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return commonMapper.websitContractSignPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean, websitId);
|
|
|
+ }
|
|
|
+
|
|
|
+ public WebsitContractSignRecordBean detail(String id) {
|
|
|
+ final WebsitContractSignRecord record = websitContractSignRecordService.getById(id);
|
|
|
+ WebsitContractSignRecordBean bean = new WebsitContractSignRecordBean();
|
|
|
+ BeanUtils.copyProperties(record, bean);
|
|
|
+ final List<WebsitContractSignItem> signItems = websitContractSignItemService.lambdaQuery()
|
|
|
+ .eq(WebsitContractSignItem::getWebsitContractSignRecordId, id)
|
|
|
+ .list();
|
|
|
+ bean.setItems(signItems);
|
|
|
+ return bean;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void cancel(String id) {
|
|
|
+ }
|
|
|
+
|
|
|
+ public void sign(String id) {
|
|
|
+ }
|
|
|
+}
|