| | |
| | | } |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<HiddenDangerEntity> hiddenDangerEntities = new ArrayList<>(); |
| | | if(type == 1){ |
| | | if(type == 1){//审核列表 |
| | | if (sysUserInfo.getUserType() == 2){ |
| | | map.put("createUser",sysUserInfo.getUserId()); |
| | | } |
| | | //小程序 待审核排前面 待审核按时间正序 审核成功的倒叙 |
| | | hiddenDangerEntities = hiddenDangerMapper.selectAppList(map); |
| | | }else { |
| | | }else if(type == 2){//隐患举报详情列表 |
| | | if (sysUserInfo.getUserType() == 2){ |
| | | map.put("createUser",sysUserInfo.getUserId()); |
| | | } |
| | | //小程序 待审核排前面 待审核按时间正序 审核成功的倒叙 |
| | | hiddenDangerEntities = hiddenDangerMapper.selectPageList(map); |
| | | } |
| | | else { |
| | | //web 按时间倒序 |
| | | hiddenDangerEntities = hiddenDangerMapper.selectPageList(map); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | 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); |
| | |
| | | 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(); |
| | | hiddenDangerEntity.setDangerLocation(null); |
| | | synchronized (Lock){ |
| | | hiddenDangerMapper.update(hiddenDangerEntity); |
| | | IntegralAccountEntity integralAccountEntity = IntegralAccountEntity |
| | | .builder() |
| | | .userId(platUserId) |
| | | .id(UUIDUtils.create()) |
| | | .accumulateIntegral(accumulateIntegral+hiddenDangerEntity.getIntegral()) |
| | | .totalIntegral(totalIntegral+hiddenDangerEntity.getIntegral()) |
| | | .userType(sysUserInfo.getUserType()) |
| | | .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(); |
| | | IntegralDetailEntity integralDetailEntity = IntegralDetailEntity |
| | | .builder() |
| | | .id(UUIDUtils.create()) |
| | | .balanc(totalIntegral+hiddenDangerEntity.getIntegral()) |
| | | .integralSource("隐患审核") |
| | | .integralWater(hiddenDangerEntity.getIntegral()) |
| | | .createTime(new Date()) |
| | | .createUser(sysUserInfo.getUserId()) |
| | | .userType(sysUserInfo.getUserType()) |
| | | .userId(platUserId) |
| | | .type(1) |
| | | .remark("隐患审核") |
| | | .companyId(sysUserInfo.getCompanyId()) |
| | | .build(); |
| | | |
| | | integralDetailMapper.insertAndUpdateAccount(integralAccountEntity); |
| | | integralDetailMapper.insertDetailAndUpdate(integralDetailEntity); |
| | | integralDetailMapper.insertAndUpdateAccount(integralAccountEntity); |
| | | integralDetailMapper.insertDetailAndUpdate(integralDetailEntity); |
| | | } |
| | | return BasicResult.success(); |
| | | } |
| | | } |