Browse Source

fix: 卫生管理添加数据权限

zhongwei
liwen 7 months ago
parent
commit
151b8c4180
  1. 7
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java
  2. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml
  3. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java
  4. 14
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml
  5. 4
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java
  6. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java

7
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.java

@ -1,10 +1,11 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.vo.HygieneMonthVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
@ -14,7 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2023-12-27
*/
@Mapper
public interface HygienePlanMapper extends BaseMapper<HygienePlanEntity> {
public interface HygienePlanMapper extends UserDataScopeBaseMapper<HygienePlanEntity> {
/**
* 查询当月各单位的卫生自查总数
@ -23,6 +24,7 @@ public interface HygienePlanMapper extends BaseMapper<HygienePlanEntity> {
* @param month 月份
* @return 当月的卫生自查总数据
*/
@UserDataAuth
IPage<HygieneMonthVO> selectByMonth(IPage<HygieneMonthVO> page, String unit, String month);
/**
@ -32,5 +34,6 @@ public interface HygienePlanMapper extends BaseMapper<HygienePlanEntity> {
* @param month 月份
* @return 当月的已完成数据
*/
@UserDataAuth
IPage<HygieneMonthVO> selectFinishedDataByMonth(IPage<HygieneMonthVO> page, String unit, String month);
}

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygienePlanMapper.xml

@ -3,7 +3,7 @@
<select id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO">
SELECT
unit, count(1) as scheduled_check_num
unit, count(1) as scheduled_check_num, create_user, create_dept
FROM
hzims_hygiene_plan
WHERE
@ -20,7 +20,7 @@
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO">
SELECT
unit, count(1) as finished_check_num
unit, count(1) as finished_check_num, create_user, create_dept
FROM
hzims_hygiene_plan
WHERE

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.java

@ -1,12 +1,14 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity;
import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.annotation.UserDataAuth;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
import java.util.Map;
/**
@ -16,7 +18,7 @@ import java.util.Map;
* @date 2023-12-27
*/
@Mapper
public interface HygieneRecordMapper extends BaseMapper<HygieneRecordEntity> {
public interface HygieneRecordMapper extends UserDataScopeBaseMapper<HygieneRecordEntity> {
/**
* 查询卫生自查记录详情
@ -31,5 +33,13 @@ public interface HygieneRecordMapper extends BaseMapper<HygieneRecordEntity> {
* @param page 分页类
* @return 记录数据页
*/
@UserDataAuth
IPage<HygieneRecordPageVO> recordPage(IPage<HygieneRecordPageVO> page, Map<String, Object> param);
/**
* 查询当月卫生自查记录
* @param month 当月
* @return 当月卫生自查数据表
*/
List<HygieneRecordEntity> selectHygieneByMonth(String month);
}

14
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneRecordMapper.xml

@ -14,7 +14,7 @@
<select id="recordPage" resultType="com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO">
SELECT
id, unit, actual_start_time, actual_end_time, check_user, week_num, hygiene_plan_id
id, unit, actual_start_time, actual_end_time, check_user, week_num, hygiene_plan_id, create_user, create_dept
FROM
hzims_hygiene_record
WHERE
@ -34,4 +34,16 @@
ORDER BY
create_time DESC
</select>
<select id="selectHygieneByMonth" resultType="com.hnac.hzims.safeproduct.entity.HygieneRecordEntity">
SELECT
*
FROM
hzims_hygiene_record
WHERE
is_deleted = 0
AND create_time like concat(#{month}, '%')
ORDER BY
code DESC
</select>
</mapper>

4
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/HygieneZoneMapper.java

@ -1,8 +1,8 @@
package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/**
* 卫生自查责任区Mapper类
@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2024-01-02
*/
@Mapper
public interface HygieneZoneMapper extends BaseMapper<HygieneZoneEntity> {
public interface HygieneZoneMapper extends UserDataScopeBaseMapper<HygieneZoneEntity> {
}

5
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/HygieneRecordServiceImpl.java

@ -218,10 +218,7 @@ public class HygieneRecordServiceImpl extends ServiceImpl<HygieneRecordMapper, H
* @return 当月卫生自查数据表
*/
private List<HygieneRecordEntity> getHygieneByMonth(String month) {
QueryWrapper<HygieneRecordEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().like(HygieneRecordEntity::getCreateTime, month)
.orderByDesc(HygieneRecordEntity::getCode);
return this.list(queryWrapper);
return baseMapper.selectHygieneByMonth(month);
}
/**

Loading…
Cancel
Save