Browse Source

修改数据权限

dev
caoyizhong 2 years ago
parent
commit
f81741b1b3
  1. 8
      hy-boot-base/hy-boot-base-core/src/main/java/org/hy/common/constant/DataBaseConstant.java
  2. 4
      hy-boot-base/hy-boot-base-core/src/main/java/org/hy/common/system/util/JwtUtil.java
  3. 3
      hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/waste/controller/ProcessWasteController.java
  4. 4
      hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/waste/mapper/ProcessWasteMapper.java
  5. 2
      hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/waste/mapper/xml/ProcessWasteMapper.xml
  6. 8
      hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/waste/service/impl/ProcessWasteServiceImpl.java
  7. 2
      hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/wastematerials/controller/ProcessWasteMaterialsController.java
  8. 2
      hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/wastematerials/mapper/ProcessWasteMaterialsMapper.java
  9. 1
      hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/wastematerials/mapper/xml/ProcessWasteMaterialsMapper.xml
  10. 4
      hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/wastematerials/service/impl/ProcessWasteMaterialsServiceImpl.java

8
hy-boot-base/hy-boot-base-core/src/main/java/org/hy/common/constant/DataBaseConstant.java

@ -56,6 +56,14 @@ public interface DataBaseConstant {
* 系统日期"yyyy-MM-dd"
*/
public static final String SYS_DATE_TABLE = "sys_date";
/**
* 部门id
*/
public static final String SYS_DEPART_ID = "departId";
/**
* 部门ID
*/
public static final String SYS_DEPART_ID_TABLE = "depart_id";
/**
* 系统时间"yyyy-MM-dd HH:mm"
*/

4
hy-boot-base/hy-boot-base-core/src/main/java/org/hy/common/system/util/JwtUtil.java

@ -188,6 +188,10 @@ public class JwtUtil {
else if (key.equals(DataBaseConstant.SYS_DATE)|| key.toLowerCase().equals(DataBaseConstant.SYS_DATE_TABLE)) {
returnValue = DateUtils.formatDate();
}
//替换为当前登陆人所属部门
else if (key.equals(DataBaseConstant.SYS_DEPART_ID)|| key.toLowerCase().equals(DataBaseConstant.SYS_DEPART_ID_TABLE)) {
returnValue = sysUser.getDepartIds();
}
//替换为当前系统时间(年月日时分秒)
else if (key.equals(DataBaseConstant.SYS_TIME)|| key.toLowerCase().equals(DataBaseConstant.SYS_TIME_TABLE)) {
returnValue = DateUtils.now();

3
hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/waste/controller/ProcessWasteController.java

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.hy.common.api.vo.Result;
import org.hy.common.aspect.annotation.AutoLog;
import org.hy.common.aspect.annotation.PermissionData;
import org.hy.common.system.base.controller.JeecgController;
import org.hy.common.system.query.QueryGenerator;
import org.hy.modules.waste.entity.ProcessWaste;
@ -49,6 +50,7 @@ public class ProcessWasteController extends JeecgController<ProcessWaste, IProce
@AutoLog(value = "废旧物资库表-分页列表查询")
@ApiOperation(value="废旧物资库表-分页列表查询", notes="废旧物资库表-分页列表查询")
@GetMapping(value = "/list")
@PermissionData(pageComponent="waste/ProcessWasteList")
public Result<?> queryPageList(ProcessWaste processWaste,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@ -72,6 +74,7 @@ public class ProcessWasteController extends JeecgController<ProcessWaste, IProce
@AutoLog(value = "废旧物资库表-报废台账分页列表查询")
@ApiOperation(value="废旧物资库表-报废台账分页列表查询", notes="废旧物资库表-报废台账分页列表查询")
@GetMapping(value = "/listCable")
@PermissionData(pageComponent="waste/ProcessWasteList")
public Result<?> queryPageLists(ProcessWaste processWaste,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,

4
hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/waste/mapper/ProcessWasteMapper.java

@ -18,9 +18,9 @@ import java.util.List;
*/
public interface ProcessWasteMapper extends BaseMapper<ProcessWaste> {
IPage<ProcessWasteVO> paging(Page page, @Param("param") ProcessWaste processWaste);
IPage<ProcessWasteVO> paging(Page page, @Param("param") ProcessWaste processWaste,@Param("permissionSql")String permissionSql);
IPage<ProcessWaste> pagingCable(Page page,@Param("param") ProcessWaste processWaste);
IPage<ProcessWaste> pagingCable(Page page,@Param("param") ProcessWaste processWaste,@Param("permissionSql")String permissionSql);
List<ProcessWaste> pagingByEc();

2
hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/waste/mapper/xml/ProcessWasteMapper.xml

@ -15,6 +15,7 @@
JOIN process_description pd on pw.description_id = pd.id
JOIN process_merchandise_news pmn on pw.merchandise_news_id = pmn.id
<where>
${permissionSql}
<if test="param.materialNameSearch !='' and param.materialNameSearch != null">
and pw.material_name like concat('%',#{param.materialNameSearch},'%')
</if>
@ -49,6 +50,7 @@
JOIN process_description pd on pw.description_id = pd.id
JOIN process_merchandise_news pmn on pw.merchandise_news_id = pmn.id
<where>
${permissionSql}
<if test="param.materialName !='' and param.materialName != null">
and pw.material_name like concat('%',#{param.materialName},'%')
</if>

8
hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/waste/service/impl/ProcessWasteServiceImpl.java

@ -16,6 +16,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
import org.hy.common.api.vo.Result;
import org.hy.common.system.query.QueryGenerator;
import org.hy.common.system.vo.LoginUser;
import org.hy.common.util.oConvertUtils;
import org.hy.modules.description.entity.ProcessDescription;
@ -71,13 +72,16 @@ public class ProcessWasteServiceImpl extends ServiceImpl<ProcessWasteMapper, Pro
@Override
public IPage<ProcessWasteVO> paging(Page page, ProcessWaste processWaste) {
IPage<ProcessWasteVO> paging = processWasteMapper.paging(page, processWaste);
String sql = QueryGenerator.installAuthJdbc(ProcessWaste.class);
IPage<ProcessWasteVO> paging = processWasteMapper.paging(page, processWaste,sql);
return paging;
}
@Override
public IPage<ProcessWaste> pagingCable(Page page, ProcessWaste processWaste) {
IPage<ProcessWaste> pagingCable = processWasteMapper.pagingCable(page, processWaste);
String sql = QueryGenerator.installAuthJdbc(ProcessWaste.class);
IPage<ProcessWaste> pagingCable = processWasteMapper.pagingCable(page, processWaste,sql);
return pagingCable;
}

2
hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/wastematerials/controller/ProcessWasteMaterialsController.java

@ -9,6 +9,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.hy.common.api.vo.Result;
import org.hy.common.aspect.annotation.AutoLog;
import org.hy.common.aspect.annotation.PermissionData;
import org.hy.common.system.base.controller.JeecgController;
import org.hy.common.system.query.QueryGenerator;
import org.hy.common.system.vo.LoginUser;
@ -62,6 +63,7 @@ public class ProcessWasteMaterialsController extends JeecgController<ProcessWast
@AutoLog(value = "账外物资库-分页列表查询")
@ApiOperation(value="账外物资库-分页列表查询", notes="账外物资库-分页列表查询")
@GetMapping(value = "/list")
@PermissionData(pageComponent="wastematerials/ProcessWasteMaterialsList")
public Result<?> queryPageList(ProcessWasteMaterials processWasteMaterials,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,

2
hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/wastematerials/mapper/ProcessWasteMaterialsMapper.java

@ -21,7 +21,7 @@ import java.util.List;
*/
public interface ProcessWasteMaterialsMapper extends BaseMapper<ProcessWasteMaterials> {
IPage<ProcessWasteMaterials> paging(Page page,@Param("param") ProcessWasteMaterials processWasteMaterials);
IPage<ProcessWasteMaterials> paging(Page page,@Param("param") ProcessWasteMaterials processWasteMaterials,@Param("permissionSql")String permissionSql);
IPage<ProcessWasteMaterials> pagings(Page page,@Param("param") ProcessWasteMaterialsDTO processWasteMaterials);

1
hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/wastematerials/mapper/xml/ProcessWasteMaterialsMapper.xml

@ -14,6 +14,7 @@
JOIN process_description pd ON pwm.description_id = pd.id
JOIN process_merchandise_news pmn ON pwm.merchandise_news_id = pmn.id
<where>
${permissionSql}
<if test="param.materialGroup != '' and param.materialGroup != null">
and pd.material_classify like concat('%',#{param.materialGroup},'%')
</if>

4
hy-boot-module-service/hy-boot-module-service-materials/src/main/java/org/hy/modules/wastematerials/service/impl/ProcessWasteMaterialsServiceImpl.java

@ -15,6 +15,7 @@ import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
import org.hy.common.api.vo.Result;
import org.hy.common.system.query.QueryGenerator;
import org.hy.common.system.vo.LoginUser;
import org.hy.modules.description.entity.ProcessDescription;
import org.hy.modules.description.mapper.ProcessDescriptionMapper;
@ -76,7 +77,8 @@ public class ProcessWasteMaterialsServiceImpl extends ServiceImpl<ProcessWasteMa
@Override
public IPage<ProcessWasteMaterials> paging(Page page, ProcessWasteMaterials processWasteMaterials) {
IPage<ProcessWasteMaterials> paging = processWasteMaterialsMapper.paging(page, processWasteMaterials);
String sql = QueryGenerator.installAuthJdbc(ProcessWasteMaterials.class);
IPage<ProcessWasteMaterials> paging = processWasteMaterialsMapper.paging(page, processWasteMaterials,sql);
return paging;
}

Loading…
Cancel
Save