| | |
| | | package com.zt.life.modules.project.service; |
| | | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.core.context.User; |
| | | import com.zt.core.context.UserContext; |
| | | import com.zt.life.modules.project.dao.ProjectDao; |
| | | import com.zt.life.modules.project.dto.MyProjectRoleDto; |
| | | import com.zt.life.modules.project.model.Project; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | /** |
| | | * project |
| | | * |
| | | * @author zt generator |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-11-07 |
| | | */ |
| | | @Service |
| | | public class ProjectService extends BaseService<ProjectDao, Project> { |
| | | public class ProjectService extends BaseService<ProjectDao, Project> { |
| | | /** |
| | | * 分页查询 |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | public List<Project> page(QueryFilter queryFilter) { |
| | | User user = UserContext.getUser(); |
| | | Integer secretClass = user.getSecretClass(); |
| | | Long deptId = user.getDeptId(); |
| | | queryFilter.getQueryParams().put("secretClass", secretClass); |
| | | queryFilter.getQueryParams().put("deptId", deptId); |
| | | return baseDao.getList(queryFilter.getQueryParams()); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public List<String> getCode() { |
| | | return baseDao.getCode(); |
| | | public MyProjectRoleDto getMyProjectRole(Long projectId) { |
| | | Long userId = UserContext.getUser().getId(); |
| | | MyProjectRoleDto data = baseDao.getMyProjectRole(projectId, userId); |
| | | return data; |
| | | } |
| | | |
| | | public Project getProject(String code) { |
| | | return baseDao.getProject(code); |
| | | public void deleteItem(Long[] ids, String tableName, String fieldName) { |
| | | for (Long id : ids){ |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("id", id); |
| | | params.put("tableName", tableName); |
| | | params.put("fieldName", fieldName); |
| | | baseDao.deleteItem(params); |
| | | } |
| | | |
| | | } |
| | | } |