|
@@ -4,15 +4,15 @@ import cn.hutool.core.util.StrUtil;
|
|
|
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.workorder.PgAppraiseApplyBean;
|
|
|
+import com.gree.mall.manager.bean.workorder.PgAppraiseApplyVO;
|
|
|
import com.gree.mall.manager.bean.workorder.PgAppraiseCategoryVO;
|
|
|
import com.gree.mall.manager.commonmapper.CommonMapper;
|
|
|
+import com.gree.mall.manager.enums.workorder.AppraiseConfigTypeEnum;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
-import com.gree.mall.manager.plus.entity.PgAppraiseCategory;
|
|
|
-import com.gree.mall.manager.plus.entity.PgAppraiseConfig;
|
|
|
-import com.gree.mall.manager.plus.service.PgAppraiseApplyService;
|
|
|
-import com.gree.mall.manager.plus.service.PgAppraiseCategoryService;
|
|
|
-import com.gree.mall.manager.plus.service.PgAppraiseConfigService;
|
|
|
+import com.gree.mall.manager.plus.entity.*;
|
|
|
+import com.gree.mall.manager.plus.service.*;
|
|
|
import com.gree.mall.manager.utils.CommonUtils;
|
|
|
import com.gree.mall.manager.utils.excel.ExcelUtils;
|
|
|
import com.gree.mall.manager.zfire.bean.ZfireParamBean;
|
|
@@ -20,6 +20,7 @@ import com.gree.mall.manager.zfire.util.FieldUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -36,6 +37,8 @@ public class AppraiseRelaLogic {
|
|
|
private final PgAppraiseConfigService pgAppraiseConfigService;
|
|
|
private final PgAppraiseCategoryService pgAppraiseCategoryService;
|
|
|
private final PgAppraiseApplyService pgAppraiseApplyService;
|
|
|
+ private final PgAppraiseApplyItemService pgAppraiseApplyItemService;
|
|
|
+ private final PgOrderBaseService pgOrderBaseService;
|
|
|
|
|
|
public List<PgAppraiseConfig> configList() {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
@@ -44,12 +47,20 @@ public class AppraiseRelaLogic {
|
|
|
.list();
|
|
|
}
|
|
|
|
|
|
+ public void configSave(PgAppraiseConfig config) {
|
|
|
+ config.updateById();
|
|
|
+ }
|
|
|
+
|
|
|
public IPage<PgAppraiseCategoryVO> categoryList(ZfireParamBean zfireParamBean) {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
FieldUtils.supplyParam(zfireParamBean, PgAppraiseCategoryVO.class, adminUser);
|
|
|
return commonMapper.appraiseCategoryList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
|
|
|
}
|
|
|
|
|
|
+ public PgAppraiseCategory categoryDetail(String id) {
|
|
|
+ return pgAppraiseCategoryService.getById(id);
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional
|
|
|
public void categorySave(PgAppraiseCategory category) {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
@@ -146,4 +157,90 @@ public class AppraiseRelaLogic {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public IPage<PgAppraiseApplyVO> applyList(ZfireParamBean zfireParamBean) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+ FieldUtils.supplyParam(zfireParamBean, PgAppraiseCategoryVO.class, adminUser);
|
|
|
+ return commonMapper.appraiseApplyList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public PgAppraiseApplyBean applyDetail(String id) {
|
|
|
+ final PgAppraiseApply apply = pgAppraiseApplyService.getById(id);
|
|
|
+ PgAppraiseApplyBean bean = new PgAppraiseApplyBean();
|
|
|
+ BeanUtils.copyProperties(apply, bean);
|
|
|
+ final List<PgAppraiseApplyItem> items = pgAppraiseApplyItemService.lambdaQuery()
|
|
|
+ .eq(PgAppraiseApplyItem::getPgAppraiseApplyId, id)
|
|
|
+ .list();
|
|
|
+ bean.setItems(items);
|
|
|
+ return bean;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional
|
|
|
+ public void applySubmit(PgAppraiseApplyBean bean) {
|
|
|
+ AdminUserCom adminUser = commonLogic.getAdminUser();
|
|
|
+ if (StringUtils.isBlank(bean.getOrderBaseId())) {
|
|
|
+ throw new RemoteServiceException("工单编号不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(bean.getReason())) {
|
|
|
+ throw new RemoteServiceException("申诉理由不能为空");
|
|
|
+ }
|
|
|
+ final PgOrderBase orderBase = pgOrderBaseService.getById(bean.getOrderBaseId());
|
|
|
+
|
|
|
+ final Integer applyCount = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .eq(PgAppraiseApply::getIsSecond, true)
|
|
|
+ .eq(PgAppraiseApply::getOrderBaseId, bean.getOrderBaseId())
|
|
|
+ .count();
|
|
|
+
|
|
|
+ // 查询有没有驳回不可申诉人
|
|
|
+ final Integer superEndCount = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .eq(PgAppraiseApply::getOrderBaseId, bean.getOrderBaseId())
|
|
|
+ .isNotNull(PgAppraiseApply::getRejectTime)
|
|
|
+ .count();
|
|
|
+
|
|
|
+ if (superEndCount > 0) {
|
|
|
+ throw new RemoteServiceException("不可再申诉");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询有没有驳回可重诉人
|
|
|
+ final Integer superCount = pgAppraiseApplyService.lambdaQuery()
|
|
|
+ .eq(PgAppraiseApply::getOrderBaseId, bean.getOrderBaseId())
|
|
|
+ .isNotNull(PgAppraiseApply::getRejectTime)
|
|
|
+ .count();
|
|
|
+
|
|
|
+ // 有驳回可重诉人忽略申诉配置
|
|
|
+ if (superCount == 0) {
|
|
|
+ // 1、完工时间超过配置时间的,不可再提交;
|
|
|
+ if (applyCount == 0) {
|
|
|
+ // 首次申诉
|
|
|
+ final PgAppraiseConfig config = pgAppraiseConfigService.lambdaQuery()
|
|
|
+ .eq(PgAppraiseConfig::getCompanyWechatId, orderBase.getCompanyWechatId())
|
|
|
+ .eq(PgAppraiseConfig::getType, AppraiseConfigTypeEnum.FIRST_A.getKey())
|
|
|
+ .one();
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+// pgOrderBaseService.lambdaQuery()
|
|
|
+// .eq()
|
|
|
+
|
|
|
+ //2、该工单已有中差评申诉数据的,不可再提交;(含待申诉、已申诉、待审核状态的,均不可再创建申诉)
|
|
|
+ //
|
|
|
+ //
|
|
|
+// pgAppraiseApplyService.lambdaQuery()
|
|
|
+// .eq(Pg)
|
|
|
+// .eq()
|
|
|
+// .count()
|
|
|
+ }
|
|
|
+
|
|
|
+ public void applyConfirm(PgAppraiseApplyBean bean) {
|
|
|
+ }
|
|
|
+
|
|
|
+ public void batchUpdateReset(List<String> ids) {
|
|
|
+ }
|
|
|
+
|
|
|
+ public void batchUpdateEnd(List<String> ids) {
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|