Browse Source

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

zhongwei
liwen 12 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; package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.HygienePlanEntity; import com.hnac.hzims.safeproduct.entity.HygienePlanEntity;
import com.hnac.hzims.safeproduct.vo.HygieneMonthVO; import com.hnac.hzims.safeproduct.vo.HygieneMonthVO;
import org.apache.ibatis.annotations.Mapper; 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 * @date 2023-12-27
*/ */
@Mapper @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 月份 * @param month 月份
* @return 当月的卫生自查总数据 * @return 当月的卫生自查总数据
*/ */
@UserDataAuth
IPage<HygieneMonthVO> selectByMonth(IPage<HygieneMonthVO> page, String unit, String month); IPage<HygieneMonthVO> selectByMonth(IPage<HygieneMonthVO> page, String unit, String month);
/** /**
@ -32,5 +34,6 @@ public interface HygienePlanMapper extends BaseMapper<HygienePlanEntity> {
* @param month 月份 * @param month 月份
* @return 当月的已完成数据 * @return 当月的已完成数据
*/ */
@UserDataAuth
IPage<HygieneMonthVO> selectFinishedDataByMonth(IPage<HygieneMonthVO> page, String unit, String month); 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 id="selectByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO">
SELECT SELECT
unit, count(1) as scheduled_check_num unit, count(1) as scheduled_check_num, create_user, create_dept
FROM FROM
hzims_hygiene_plan hzims_hygiene_plan
WHERE WHERE
@ -20,7 +20,7 @@
<select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO"> <select id="selectFinishedDataByMonth" resultType="com.hnac.hzims.safeproduct.vo.HygieneMonthVO">
SELECT SELECT
unit, count(1) as finished_check_num unit, count(1) as finished_check_num, create_user, create_dept
FROM FROM
hzims_hygiene_plan hzims_hygiene_plan
WHERE 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; package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity; import com.hnac.hzims.safeproduct.entity.HygieneRecordEntity;
import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO; import com.hnac.hzims.safeproduct.vo.HygieneRecordDetailVO;
import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO; import com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO;
import org.apache.ibatis.annotations.Mapper; 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; import java.util.Map;
/** /**
@ -16,7 +18,7 @@ import java.util.Map;
* @date 2023-12-27 * @date 2023-12-27
*/ */
@Mapper @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 分页类 * @param page 分页类
* @return 记录数据页 * @return 记录数据页
*/ */
@UserDataAuth
IPage<HygieneRecordPageVO> recordPage(IPage<HygieneRecordPageVO> page, Map<String, Object> param); 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="recordPage" resultType="com.hnac.hzims.safeproduct.vo.HygieneRecordPageVO">
SELECT 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 FROM
hzims_hygiene_record hzims_hygiene_record
WHERE WHERE
@ -34,4 +34,16 @@
ORDER BY ORDER BY
create_time DESC create_time DESC
</select> </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> </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; package com.hnac.hzims.safeproduct.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity; import com.hnac.hzims.safeproduct.entity.HygieneZoneEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
/** /**
* 卫生自查责任区Mapper类 * 卫生自查责任区Mapper类
@ -11,6 +11,6 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2024-01-02 * @date 2024-01-02
*/ */
@Mapper @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 当月卫生自查数据表 * @return 当月卫生自查数据表
*/ */
private List<HygieneRecordEntity> getHygieneByMonth(String month) { private List<HygieneRecordEntity> getHygieneByMonth(String month) {
QueryWrapper<HygieneRecordEntity> queryWrapper = new QueryWrapper<>(); return baseMapper.selectHygieneByMonth(month);
queryWrapper.lambda().like(HygieneRecordEntity::getCreateTime, month)
.orderByDesc(HygieneRecordEntity::getCode);
return this.list(queryWrapper);
} }
/** /**

Loading…
Cancel
Save