| | |
| | | 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 |
| | |
| | | @Autowired |
| | | private HiddenDangerMapper hiddenDangerMapper; |
| | | |
| | | @Autowired |
| | | private IntegralDetailMapper integralDetailMapper; |
| | | |
| | | @Autowired |
| | | private RegionInspectionRecordMapper regionInspectionRecordMapper; |
| | | private static final Object Lock = new Object(); |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | map.put("companyId",sysUserInfo.getCompanyId()); |
| | | int pageNum = (int) map.get("pageNum"); |
| | | int pageSize = (int) map.get("pageSize"); |
| | | int type = (int) map.get("type");//type =1 小程序来的 |
| | | int type = 0; |
| | | if( map.get("type")!= null){ |
| | | type = (int) map.get("type");//type =1 小程序来的 |
| | | } |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<HiddenDangerEntity> hiddenDangerEntities = new ArrayList<>(); |
| | | if(type == 1){ |
| | |
| | | obj.setAuditStatusName("未审核"); |
| | | break; |
| | | case 1: |
| | | obj.setAuditStatusName("审核通过"); |
| | | obj.setAuditStatusName("已审核"); |
| | | break; |
| | | case 2: |
| | | obj.setAuditStatusName("审核失败"); |
| | |
| | | |
| | | @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(); |
| | | } |
| | | } |