From b59994e2c9974618d6c579cf3893a504c94fc2f7 Mon Sep 17 00:00:00 2001 From: 叶松 <2217086471@qq.com> Date: 星期二, 28 十一月 2023 08:38:07 +0800 Subject: [PATCH] Merge branch 'master' of http://111.30.93.211:10101/r/supipe --- hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/service/impl/HiddenDangerServiceImpl.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 47 insertions(+), 4 deletions(-) diff --git a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/service/impl/HiddenDangerServiceImpl.java b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/service/impl/HiddenDangerServiceImpl.java index cc10f59..82cffe1 100644 --- a/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/service/impl/HiddenDangerServiceImpl.java +++ b/hd/pipe/secure/src/main/java/com/thhy/secure/modules/biz/hiddenDanger/service/impl/HiddenDangerServiceImpl.java @@ -10,15 +10,17 @@ import com.thhy.secure.modules.biz.hiddenDanger.entity.HiddenDangerEntity; import com.thhy.secure.modules.biz.hiddenDanger.mapper.HiddenDangerMapper; import com.thhy.secure.modules.biz.hiddenDanger.service.HiddenDangerService; +import com.thhy.secure.modules.biz.integralAccount.entity.IntegralAccountEntity; +import com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailEntity; +import com.thhy.secure.modules.biz.integralAccount.mapper.IntegralDetailMapper; +import com.thhy.secure.modules.biz.regionInspection.mapper.RegionInspectionRecordMapper; +import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @Author QiuYuHao @@ -31,6 +33,11 @@ @Autowired private HiddenDangerMapper hiddenDangerMapper; + @Autowired + private IntegralDetailMapper integralDetailMapper; + + @Autowired + private RegionInspectionRecordMapper regionInspectionRecordMapper; private static final Object Lock = new Object(); @Override @Transactional(rollbackFor = Exception.class) @@ -154,8 +161,44 @@ @Override public BasicResult examine(HiddenDangerEntity hiddenDangerEntity) { + SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); + + String platUserId = regionInspectionRecordMapper.selectPlatUserId(hiddenDangerEntity.getCreateUser()); + Map platUser = regionInspectionRecordMapper.getPlatUser(platUserId); + Integer user_type = (int)platUser.get("user_type"); + + Map account = new HashMap(); + account.put("userId",platUserId); + //查询账户 + IntegralAccountEntity queryAccount = integralDetailMapper.selectByOne(account); + Double accumulateIntegral = 0.0; + Double totalIntegral = 0.0; + if (queryAccount != null){ + accumulateIntegral = queryAccount.getAccumulateIntegral();//累计积分 + totalIntegral = queryAccount.getTotalIntegral();//当前余额 + } hiddenDangerEntity.setAuditStatus(1);//1审核通过 hiddenDangerMapper.update(hiddenDangerEntity); + IntegralAccountEntity integralAccountEntity = IntegralAccountEntity + .builder() + .userId(platUserId) + .accumulateIntegral(accumulateIntegral+hiddenDangerEntity.getIntegral()) + .totalIntegral(totalIntegral+hiddenDangerEntity.getIntegral()) + .build(); + + IntegralDetailEntity integralDetailEntity = IntegralDetailEntity + .builder() + .id(UUIDUtils.create()) + .balanc(totalIntegral+hiddenDangerEntity.getIntegral()) + .integralSource("隐患审核") + .integralWater(hiddenDangerEntity.getIntegral()) + .createTime(new Date()) + .createUser(sysUserInfo.getUserId()) + .userType(user_type) + .build(); + + integralDetailMapper.insertAndUpdateAccount(integralAccountEntity); + integralDetailMapper.insertDetailAndUpdate(integralDetailEntity); return BasicResult.success(); } } -- Gitblit v1.9.3