| | |
| | | } |
| | | return name; |
| | | } |
| | | |
| | | private String auditUser; |
| | | private Date auditTime; |
| | | } |
| | |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | String userId = sysUserInfo.getUserId(); |
| | | hiddenDangerEntity.setUpdateUser(userId); |
| | | if (hiddenDangerEntity.getDictId() != null){ |
| | | hiddenDangerEntity.setDangerLocation(hiddenDangerEntity.getDictId()); |
| | | } |
| | | hiddenDangerEntity.setUpdateTime(new Date()); |
| | | synchronized (Lock){ |
| | | hiddenDangerMapper.update(hiddenDangerEntity); |
| | |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<HiddenDangerEntity> hiddenDangerEntities = new ArrayList<>(); |
| | | if(type == 1){//审核列表 |
| | | if (sysUserInfo.getUserType() == 2){ |
| | | map.put("createUser",sysUserInfo.getUserId()); |
| | | } |
| | | //小程序 待审核排前面 待审核按时间正序 审核成功的倒叙 |
| | | hiddenDangerEntities = hiddenDangerMapper.selectAppList(map); |
| | | }else if(type == 2){//隐患举报详情列表 |
| | | if (sysUserInfo.getUserType() == 2){ |
| | | map.put("createUser",sysUserInfo.getUserId()); |
| | | } |
| | | map.put("createUser",sysUserInfo.getUserId()); |
| | | //小程序 待审核排前面 待审核按时间正序 审核成功的倒叙 |
| | | hiddenDangerEntities = hiddenDangerMapper.selectPageList(map); |
| | | } |
| | | else { |
| | | } else { |
| | | //web 按时间倒序 |
| | | hiddenDangerEntities = hiddenDangerMapper.selectPageList(map); |
| | | } |
| | |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | String platUserId = regionInspectionRecordMapper.selectPlatUserId(hiddenDangerEntity.getCreateUser()); |
| | | |
| | | Map platUser = regionInspectionRecordMapper.getPlatUser(platUserId); |
| | | int user_type = (int) platUser.get("user_type"); |
| | | Map account = new HashMap(); |
| | | account.put("userId",platUserId); |
| | | //查询账户 |
| | |
| | | } |
| | | hiddenDangerEntity.setAuditStatus(1);//1审核通过 |
| | | hiddenDangerEntity.setDangerLocation(null); |
| | | hiddenDangerEntity.setAuditTime(new Date()); |
| | | hiddenDangerEntity.setAuditUser(sysUserInfo.getUserId()); |
| | | synchronized (Lock){ |
| | | hiddenDangerMapper.update(hiddenDangerEntity); |
| | | IntegralAccountEntity integralAccountEntity = IntegralAccountEntity |
| | |
| | | .id(UUIDUtils.create()) |
| | | .accumulateIntegral(accumulateIntegral+hiddenDangerEntity.getIntegral()) |
| | | .totalIntegral(totalIntegral+hiddenDangerEntity.getIntegral()) |
| | | .userType(sysUserInfo.getUserType()) |
| | | .userType(user_type) |
| | | .build(); |
| | | |
| | | IntegralDetailEntity integralDetailEntity = IntegralDetailEntity |
| | |
| | | .integralWater(hiddenDangerEntity.getIntegral()) |
| | | .createTime(new Date()) |
| | | .createUser(sysUserInfo.getUserId()) |
| | | .userType(sysUserInfo.getUserType()) |
| | | .userType(user_type) |
| | | .userId(platUserId) |
| | | .type(1) |
| | | .remark("隐患审核") |
对比新文件 |
| | |
| | | package com.thhy.secure.modules.biz.integralAccount.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.thhy.general.annotations.Excel; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Author QiuYuHao |
| | | * @CreateDate 2023-11-28 11:06:19 |
| | | */ |
| | | @Builder |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class IntegralDetailDto { |
| | | |
| | | private String id; |
| | | private Integer type;//1、获取 2、消耗 |
| | | |
| | | private String createUser; |
| | | private String companyId; |
| | | private String userId; |
| | | private Integer userType; |
| | | private Double changeIntegral;//变量在积分超市 修改前的变量 |
| | | |
| | | |
| | | @Excel(sort = 1,title = "时间") |
| | | private String createDate; |
| | | |
| | | private Date createTime; |
| | | @Excel(sort = 2,title = "积分分值") |
| | | private Double integralWater;//当前可改积分流水 |
| | | |
| | | @Excel(sort = 3,title = "余额") |
| | | private Double balanc;//当前余额 |
| | | |
| | | @Excel(sort = 4,title = "类型") |
| | | private String typeName;//1、获取 2、消耗 |
| | | private String integralSource;//积分怎么来的 |
| | | private String userTypeName; |
| | | |
| | | private String realName;//真实姓名 |
| | | |
| | | |
| | | @Excel(sort = 5,title = "说明") |
| | | private String remark;//说明 |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | private String id; |
| | | private Integer type;//1、获取 2、消耗 |
| | | @Excel(sort = 4,title = "类型") |
| | | private String typeName;//1、获取 2、消耗 |
| | | |
| | | private String integralSource;//积分怎么来的 |
| | |
| | | private String companyId; |
| | | private String userId; |
| | | private Integer userType; |
| | | @Excel(sort = 3,title = "余额") |
| | | private Double balanc;//当前余额 |
| | | |
| | | @Excel(sort = 2,title = "积分") |
| | | private Double integralWater;//当前可改积分流水 |
| | | |
| | | private Double changeIntegral;//变量在积分超市 修改前的变量 |
| | | |
| | | |
| | | @Excel(sort = 1,title = "时间") |
| | | private Date createTime; |
| | | @Excel(sort = 2,title = "人员类别") |
| | | private String userTypeName; |
| | | @Excel(sort = 3,title = "人员姓名") |
| | | private String realName;//真实姓名 |
| | | @Excel(sort = 4,title = "积分") |
| | | private Double integralWater;//当前可改积分流水 |
| | | |
| | | @Excel(sort = 5,title = "说明") |
| | | private String remark;//说明 |
| | | |
| | | @Excel(sort = 6,title = "人员姓名") |
| | | private String realName;//真实姓名 |
| | | |
| | | } |
| | |
| | | package com.thhy.secure.modules.biz.integralAccount.mapper; |
| | | |
| | | import com.thhy.secure.modules.biz.integralAccount.entity.IntegralAccountEntity; |
| | | import com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailDto; |
| | | import com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailEntity; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<IntegralDetailEntity> selectPageList(Map map); |
| | | List<IntegralDetailDto> selectPageInfoList(Map map); |
| | | |
| | | /** |
| | | * 积分超市删除 |
| | |
| | | * @param map |
| | | * @return |
| | | */ |
| | | List<IntegralDetailEntity> selectSafeIntegralInfo(Map map); |
| | | List<IntegralDetailDto> selectSafeIntegralInfo(Map map); |
| | | } |
| | |
| | | import com.thhy.general.utils.UUIDUtils; |
| | | import com.thhy.general.utils.UserInfoUtils; |
| | | import com.thhy.secure.modules.biz.integralAccount.entity.IntegralAccountEntity; |
| | | import com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailDto; |
| | | import com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailEntity; |
| | | import com.thhy.secure.modules.biz.integralAccount.mapper.IntegralDetailMapper; |
| | | import com.thhy.secure.modules.biz.integralAccount.service.IntegralDetailService; |
| | |
| | | public BasicResult delete(String id){ |
| | | Map map =new HashMap(); |
| | | map.put("id",id); |
| | | IntegralDetailEntity integralDetailEntity = integralDetailMapper.selectSafeIntegralInfo(map).get(0); |
| | | IntegralDetailDto integralDetailEntity = integralDetailMapper.selectSafeIntegralInfo(map).get(0); |
| | | Double integralWater = integralDetailEntity.getIntegralWater();//获取消耗积分 |
| | | Map account = new HashMap(); |
| | | account.put("userId",integralDetailEntity.getUserId()); |
| | |
| | | int pageSize = (int) map.get("pageSize"); |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | map.put("companyId",companyId); |
| | | List<IntegralDetailEntity> integralDetailEntities = integralDetailMapper.selectSafeIntegralInfo(map); |
| | | List<IntegralDetailDto> integralDetailEntities = integralDetailMapper.selectSafeIntegralInfo(map); |
| | | map.put("data",new PageInfo<>(integralDetailEntities)); |
| | | return BasicResult.success(map); |
| | | } |
| | |
| | | map.put("companyId",companyId); |
| | | List<IntegralDetailEntity> integralDetailEntities = integralDetailMapper.selectPageList(map); |
| | | |
| | | integralDetailEntities.forEach(obj->{ |
| | | if(obj.getUserType() ==1){ |
| | | obj.setUserTypeName("管服人员"); |
| | | } |
| | | if(obj.getUserType() ==2){ |
| | | obj.setUserTypeName("劳务人员"); |
| | | } |
| | | }); |
| | | ExcelUtils.downExcel(integralDetailEntities,IntegralDetailEntity.class,rsp,"班组列表"); |
| | | } |
| | | |
| | |
| | | public void exportSafeIntegralInfo(Map map, HttpServletResponse rsp) { |
| | | SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); |
| | | String companyId = sysUserInfo.getCompanyId(); |
| | | |
| | | IntegralAccountEntity integralAccountEntity = integralDetailMapper.selectByOne(map); |
| | | map.put("integral",integralAccountEntity.getTotalIntegral()); |
| | | map.put("companyId",companyId); |
| | | List<IntegralDetailEntity> integralDetailEntities = integralDetailMapper.selectSafeIntegralInfo(map); |
| | | ExcelUtils.downExcel(integralDetailEntities,IntegralDetailEntity.class,rsp,"班组列表"); |
| | | List<IntegralDetailDto> integralDetailEntities = integralDetailMapper.selectSafeIntegralInfo(map); |
| | | integralDetailEntities.forEach(obj->{ |
| | | if(obj.getUserType() ==1){ |
| | | obj.setUserTypeName("管服人员"); |
| | | } |
| | | if(obj.getUserType() ==2){ |
| | | obj.setUserTypeName("劳务人员"); |
| | | } |
| | | if(obj.getType() == 1){ |
| | | obj.setTypeName("获取"); |
| | | } |
| | | if(obj.getType() == 2){ |
| | | obj.setTypeName("消耗"); |
| | | } |
| | | }); |
| | | ExcelUtils.downExcel(integralDetailEntities,IntegralDetailDto.class,rsp,"班组列表"); |
| | | } |
| | | |
| | | } |
| | |
| | | <update id="update"> |
| | | update t_hidden_danger |
| | | <set> |
| | | <if test="dangerLocation != null"> |
| | | <if test="dangerLocation != null and dangerLocation !=''"> |
| | | dangerLocation = #{dangerLocation,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="title != null"> |
| | | <if test="title != null and title !=''"> |
| | | title = #{title,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="createTime != null"> |
| | |
| | | <if test="level != null"> |
| | | `level` = #{level,jdbcType=INTEGER}, |
| | | </if> |
| | | |
| | | <if test="auditUser != null"> |
| | | auditUser = #{auditUser,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="auditTime != null"> |
| | | auditTime = #{auditTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | </set> |
| | | where id=#{id,jdbcType=VARCHAR} |
| | | </update> |
| | |
| | | t.integral, |
| | | su.real_name reporter, |
| | | t.integral, |
| | | t.level |
| | | t.level, |
| | | su2.real_name auditUser, |
| | | t.auditTime |
| | | from t_hidden_danger t |
| | | LEFT JOIN sys_users su ON su.user_id = t.createUser |
| | | LEFT JOIN sys_users su1 ON su1.user_id = t.updateUser |
| | | LEFT JOIN sys_users su2 ON su2.user_id = t.auditUser |
| | | LEFT JOIN sys_dict sd on sd.dict_id = t.dangerLocation |
| | | where t.id=#{id} |
| | | </select> |
| | |
| | | t.companyId, |
| | | t.level, |
| | | t.integral, |
| | | su2.real_name auditUser, |
| | | t.auditTime, |
| | | su.real_name reporter |
| | | from t_hidden_danger t |
| | | LEFT JOIN sys_users su ON su.user_id = t.createUser |
| | | LEFT JOIN sys_users su1 ON su1.user_id = t.updateUser |
| | | LEFT JOIN sys_users su2 ON su2.user_id = t.auditUser |
| | | LEFT JOIN sys_dict sd on sd.dict_id = t.dangerLocation |
| | | WHERE |
| | | t.isUse = 1 |
| | |
| | | t.companyId, |
| | | t.level, |
| | | t.integral, |
| | | su2.real_name auditUser, |
| | | t.auditTime, |
| | | su.real_name reporter |
| | | from t_hidden_danger t |
| | | LEFT JOIN sys_users su ON su.user_id = t.createUser |
| | | LEFT JOIN sys_users su1 ON su1.user_id = t.updateUser |
| | | LEFT JOIN sys_users su2 ON su2.user_id = t.auditUser |
| | | LEFT JOIN sys_dict sd on sd.dict_id = t.dangerLocation |
| | | WHERE |
| | | t.isUse = 1 |
| | |
| | | update t_integral_detail set isUse = 0 where id = #{id,jdbcType=VARCHAR} |
| | | </delete> |
| | | |
| | | |
| | | <!-- 积分超市 --> |
| | | <select id="selectPageInfoList" resultType="com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailDto"> |
| | | SELECT |
| | | t.*, |
| | | spu.real_name realName, |
| | | spu.user_type userTypeName |
| | | FROM t_integral_detail t |
| | | LEFT JOIN sys_plat_user spu on spu.user_id = t.userId |
| | | WHERE t.isUse = 1 and t.type = 2 and t.companyId = #{companyId} |
| | | <if test="userId != null and userId !=''"> |
| | | AND spu.user_id =#{userId} |
| | | </if> |
| | | <if test="startTime != null and startTime != '' and endTime !=null and endTime !=''"> |
| | | AND t.createTime BETWEEN #{startTime} and #{endTime} |
| | | </if> |
| | | <if test="userType != null and userType != ''"> |
| | | AND t.userType = #{userType} |
| | | </if> |
| | | order by t.createTime desc |
| | | </select> |
| | | <!-- 积分超市 --> |
| | | <select id="selectPageList" resultType="com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailEntity"> |
| | | SELECT |
| | | t.id, |
| | | t.createTime, |
| | | t.*, |
| | | spu.real_name realName, |
| | | t.integralWater, |
| | | t.remark |
| | | spu.user_type userTypeName |
| | | FROM t_integral_detail t |
| | | LEFT JOIN sys_plat_user spu on spu.user_id = t.userId |
| | | WHERE t.isUse = 1 and t.type = 2 and t.companyId = #{companyId} |
| | | <if test="realName != null and realName !=''"> |
| | | AND spu.real_name LIKE CONCAT('%',#{realName},'%') |
| | | <if test="userId != null and userId !=''"> |
| | | AND spu.user_id =#{userId} |
| | | </if> |
| | | <if test="startTime != null and startTime != '' and endTime !=null and endTime !=''"> |
| | | AND t.createTime BETWEEN #{startTime} and #{endTime} |
| | | </if> |
| | | <if test="userType != null and userType != ''"> |
| | | AND t.userType = #{userType} |
| | | </if> |
| | | order by t.createTime desc |
| | | </select> |
| | |
| | | <if test="userType != null and userType !=''"> |
| | | and t.userType = #{userType} |
| | | </if> |
| | | <if test="realName != null and realName !=''"> |
| | | AND spu.real_name LIKE CONCAT('%',#{realName},'%') |
| | | <if test="userId != null and userId !=''"> |
| | | AND spu.user_id =#{userId} |
| | | </if> |
| | | <if test="startIntegral != null and startIntegral != '' and endIntegral !=null and endIntegral !=''"> |
| | | AND t.accumulateIntegral BETWEEN #{startIntegral} and #{endIntegral} |
| | | <if test="startIntegral != null and startIntegral != '' and endIntegra !=null and endIntegra !=''"> |
| | | AND t.accumulateIntegral BETWEEN #{startIntegral} and #{endIntegra} |
| | | </if> |
| | | order by t.accumulateIntegral desc |
| | | </select> |
| | | |
| | | <select id="selectSafeIntegralInfo" resultType="com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailEntity"> |
| | | <select id="selectSafeIntegralInfo" resultType="com.thhy.secure.modules.biz.integralAccount.entity.IntegralDetailDto"> |
| | | SELECT |
| | | t.* |
| | | t.*, |
| | | DATE_FORMAT(t.createTime, '%Y-%m-%d') createDate |
| | | FROM t_integral_detail t |
| | | WHERE t.isUse = 1 |
| | | <if test="companyId != null and companyId !=''"> |