From 491ad3f8d75f4254e0bb3dbc8544169e7e76f7a5 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Wed, 30 Jun 2021 16:01:22 +0800
Subject: [PATCH] modify
---
gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java b/gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java
index 9f129a9..55d7231 100644
--- a/gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java
+++ b/gc-user/src/main/java/com/xzx/gc/user/service/JhyInfoService.java
@@ -1,31 +1,41 @@
package com.xzx.gc.user.service;
import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xzx.gc.common.exception.RestException;
+import com.xzx.gc.entity.AccountInfo;
import com.xzx.gc.entity.JhyInfo;
+import com.xzx.gc.entity.ScoreGoodsSearch;
+import com.xzx.gc.user.dto.AddScoreNumDto;
import com.xzx.gc.user.dto.ExamineJwyDto;
import com.xzx.gc.user.dto.JhyApplyDto;
import com.xzx.gc.user.dto.JhyInfoListDto;
+import com.xzx.gc.user.mapper.AccountMapper;
import com.xzx.gc.user.mapper.JhyInfoMapper;
import com.xzx.gc.user.vo.JhyInfoListVo;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+@Slf4j
@Service
@Transactional
public class JhyInfoService {
@Autowired
private JhyInfoMapper jhyInfoMapper;
+ @Autowired
+ private AccountMapper accountMapper;
public void applyJhy(JhyApplyDto applyDto) {
JhyInfo mobileIsExist = jhyInfoMapper.selectExistJhyByIndeityOrMobile(applyDto.getMobile(), applyDto.getIdentity());
@@ -39,9 +49,13 @@
jhyInfoMapper.deleteByUserId(applyDto.getUserId());
+ log.info("图片地址:{}", applyDto.getCardPos());
JhyInfo jhyInfo = new JhyInfo();
BeanUtil.copyProperties(applyDto, jhyInfo);
jhyInfo.setCreatedTime(new Date());
+ jhyInfo.setIsJhy(JhyInfo.IS_JHY_N);
+ jhyInfo.setCardPos(applyDto.getCardPos());
+ jhyInfo.setStatus(JhyInfo.CHECK_WAIT);
jhyInfoMapper.insert(jhyInfo);
}
@@ -54,13 +68,21 @@
return jhyInfo.getStatus();
}
- public boolean isJhy(String userId) {
+ public int isJhy(String userId) {
JhyInfo jhyInfo = jhyInfoMapper.selectJhyInfoByUserId(userId);
if (jhyInfo == null) {
- return false;
+ return 0;
}
- return JhyInfo.CHECK_PASS.equals(jhyInfo.getStatus());
+ if (JhyInfo.CHECK_REFUSE.equals(jhyInfo.getStatus())) {
+ return 0;
+ }
+
+ if (JhyInfo.CHECK_PASS.equals(jhyInfo.getStatus())) {
+ return 1;
+ } else {
+ return 2;
+ }
}
public Map<String, Object> queryList(JhyInfoListDto jhyInfoListDto) {
@@ -89,4 +111,18 @@
}
jhyInfoMapper.updateByPrimaryKey(jhyInfo);
}
+
+ public void addScoreNum(AddScoreNumDto model) {
+ Example exampleAccount = new Example(AccountInfo.class);
+ Example.Criteria criteriaAccount = exampleAccount.createCriteria();
+ criteriaAccount.andEqualTo("userId",model.getUserId());
+ List<AccountInfo> accountInfos = accountMapper.selectByExample(exampleAccount);
+ if(CollUtil.isNotEmpty(accountInfos)){
+ AccountInfo accountInfo = accountInfos.get(0);
+// Integer collectScore = Integer.parseInt(accountInfo.getCollectScore());
+// collectScore = collectScore + model.getScore();
+ accountInfo.setCollectScore(model.getScore().toString());
+ accountMapper.updateByPrimaryKey(accountInfo);
+ }
+ }
}
--
Gitblit v1.9.1