forked from Gitlink/microservices
Merge branch 'master' of code.gitlink.org.cn:Gitlink/microservices into dev_monitoring
This commit is contained in:
commit
8184eb2401
|
|
@ -12,7 +12,7 @@ public class MakerSpaceTotalDataVo {
|
|||
|
||||
private int totalApplicants;
|
||||
|
||||
private int currentTotalAwardAmount;
|
||||
private float currentTotalAwardAmount;
|
||||
|
||||
private float paidAwardAmount;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public interface TasksMapper{
|
|||
|
||||
int getTotalApplicantCount();
|
||||
|
||||
int getCurrentTotalAwardAmount();
|
||||
float getCurrentTotalAwardAmount();
|
||||
|
||||
List<Object> getTaskPublishedCountsByYear();
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class TasksServiceImpl implements ITasksService {
|
|||
MakerSpaceTotalDataVo makerSpaceTotalDataVo = new MakerSpaceTotalDataVo();
|
||||
makerSpaceTotalDataVo.setTotalTasks(tasksMapper.getTotalTaskCount());
|
||||
makerSpaceTotalDataVo.setTotalApplicants(tasksMapper.getTotalApplicantCount());
|
||||
makerSpaceTotalDataVo.setCurrentTotalAwardAmount(tasksMapper.getCurrentTotalAwardAmount()/10000);
|
||||
makerSpaceTotalDataVo.setCurrentTotalAwardAmount(tasksMapper.getCurrentTotalAwardAmount() /10000L);
|
||||
makerSpaceTotalDataVo.setPaidAwardAmount(tasksMapper.getPaidAwardAmount()/10000);
|
||||
makerSpaceTotalDataVo.setTotalVisits(tasksMapper.getTotalVisits());
|
||||
makerSpaceTotalDataVo.setTaskPublishedCountsByYear(tasksMapper.getTaskPublishedCountsByYear());
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from papers
|
||||
where is_delete = 0 and parent_id = 0
|
||||
</select>
|
||||
<select id="getCurrentTotalAwardAmount" resultType="java.lang.Integer">
|
||||
select sum(bounty)
|
||||
<select id="getCurrentTotalAwardAmount" resultType="java.lang.Float">
|
||||
select COALESCE(SUM(bounty), 0)
|
||||
from tasks
|
||||
where is_delete = 0 and `status` between 3 and 8
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -72,4 +72,7 @@ public class PmsDocumentVo
|
|||
|
||||
@ApiModelProperty(value = "是否被收藏")
|
||||
private Boolean isFavour;
|
||||
|
||||
@ApiModelProperty(value = "是否存在子文件夹")
|
||||
private Boolean hasChildDir=false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,4 +86,6 @@ public interface PmsDocumentMapper
|
|||
Long[] selectLinkedRepoIds(@Param("enterpriseId") Long enterpriseId, @Param("projectId") Long projectId);
|
||||
|
||||
List<PmsDocument> selectPmsFavoriteDocumentList(PmsDocumentFavoriteSearchVo pmsDocumentFavoriteSearchVo);
|
||||
|
||||
boolean hasChildDirById(@Param("documentId") Long documentId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,6 +231,9 @@ public class PmsDocumentServiceImpl implements IPmsDocumentService
|
|||
}
|
||||
pmsDocumentVo.setWikiRepositorySimpleInfo(wikiRepositoryInfo);
|
||||
pmsDocumentVo.setIsFavour(pmsDocumentUserFavoriteMapper.isDocumentInFavorites(SecurityUtils.getUserId(), pmsDocument.getId()));
|
||||
if (PmsDocumentType.DOCUMENT_DIRECTORY.getKey() == pmsDocumentVo.getDocType()) {
|
||||
pmsDocumentVo.setHasChildDir(pmsDocumentMapper.hasChildDirById(pmsDocument.getId()));
|
||||
}
|
||||
return pmsDocumentVo;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,4 +160,15 @@ public class PmsEnterpriseController extends BaseController
|
|||
@ApiParam(name = "gitlinkOrgId", value = "gitlink组织Id") @PathVariable Long gitlinkOrgId) {
|
||||
return genericsSuccess(pmsEnterpriseService.getWorkbenchUrl(gitlinkOrgId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目ID查询所属组织标识
|
||||
*/
|
||||
@GetMapping("/getEnterpriseIdentifierByProjectId/{projectId}")
|
||||
@ApiOperation(value = "根据项目ID查询所属组织标识")
|
||||
public GenericsAjaxResult<String> getEnterpriseIdentifierByProjectId(
|
||||
@ApiParam(name = "projectId", value = "项目Id") @PathVariable Long projectId) {
|
||||
return genericsSuccess(pmsEnterpriseService.getEnterpriseByProjectId(projectId).getEnterpriseIdentifier());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,4 +149,7 @@ public interface IPmsEnterpriseService {
|
|||
void increaseOpenEnterpriseProcessCount(Long gitlinkOrgId);
|
||||
|
||||
void decreaseOpenEnterpriseProcessCount(Long gitlinkOrgId);
|
||||
|
||||
|
||||
PmsEnterprise getEnterpriseByProjectId(Long projectId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|||
import com.microservices.common.core.constant.CacheConstants;
|
||||
import com.microservices.common.core.constant.HttpStatus;
|
||||
import com.microservices.common.core.constant.SecurityConstants;
|
||||
import com.microservices.common.core.context.SecurityContextHolder;
|
||||
import com.microservices.common.core.enums.SystemRole;
|
||||
import com.microservices.common.core.exception.ServiceException;
|
||||
import com.microservices.common.core.utils.DateUtils;
|
||||
|
|
@ -28,6 +29,7 @@ import com.microservices.pms.product.domain.vo.PmsProductSearchVo;
|
|||
import com.microservices.pms.product.service.IPmsProductRequirementTagService;
|
||||
import com.microservices.pms.product.service.IPmsProductService;
|
||||
import com.microservices.pms.project.domain.PmsProject;
|
||||
import com.microservices.pms.project.mapper.PmsProjectMapper;
|
||||
import com.microservices.pms.project.service.IPmsProjectService;
|
||||
import com.microservices.pms.utils.PmsConstants;
|
||||
import com.microservices.pms.utils.PmsGitLinkRequestUrl;
|
||||
|
|
@ -87,6 +89,8 @@ public class PmsEnterpriseServiceImpl implements IPmsEnterpriseService {
|
|||
private RedisService redisService;
|
||||
@Value("${pms.pmsUrl}")
|
||||
private String pmsUrl;
|
||||
@Autowired
|
||||
private PmsProjectMapper pmsProjectMapper;
|
||||
|
||||
/**
|
||||
* 查询项目管理企业
|
||||
|
|
@ -617,4 +621,14 @@ public class PmsEnterpriseServiceImpl implements IPmsEnterpriseService {
|
|||
private Boolean checkEnterpriseInitComplete(Long gitlinkOrgId) {
|
||||
return !redisService.hasKey(CacheConstants.getGitlinkOrgIdOpenEnterpriseKey(gitlinkOrgId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PmsEnterprise getEnterpriseByProjectId(Long projectId) {
|
||||
PmsProject pmsProject = pmsProjectMapper.selectPmsProjectById(projectId);
|
||||
PmsEnterprise pmsEnterprise = pmsEnterpriseMapper.selectPmsEnterpriseById(pmsProject.getPmsEnterpriseId());
|
||||
// // 手动注入上下文
|
||||
// SecurityContextHolder.setDeptId(pmsEnterprise.getDeptId().toString());
|
||||
// checkEnterpriseIsCurrentEnterprise(pmsEnterprise);
|
||||
return pmsEnterprise;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ public class PmsProjectIssuesController extends BaseController {
|
|||
@RequiresPermissions("pms:pmsProjectIssues:add")
|
||||
@PostMapping("/add")
|
||||
@ApiOperation(value = "新增项目工作项")
|
||||
public AjaxResult add(@RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
||||
public AjaxResult add(@PathVariable String enterpriseIdentifier, @RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
||||
pmsProjectIssuesInputVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||
JSONObject result = pmsProjectIssuesService.insertPmsProjectIssuesRestricted(pmsProjectIssuesInputVo);
|
||||
return success(result);
|
||||
}
|
||||
|
|
@ -66,7 +67,8 @@ public class PmsProjectIssuesController extends BaseController {
|
|||
@RequiresPermissions("pms:pmsProjectIssues:edit")
|
||||
@PostMapping("/edit/{id}")
|
||||
@ApiOperation(value = "编辑项目工作项")
|
||||
public AjaxResult edit(@PathVariable("id") Long id, @RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
||||
public AjaxResult edit(@PathVariable("id") Long id, @PathVariable String enterpriseIdentifier, @RequestBody PmsProjectIssuesInputVo pmsProjectIssuesInputVo) {
|
||||
pmsProjectIssuesInputVo.setEnterpriseIdentifier(enterpriseIdentifier);
|
||||
JSONObject result = pmsProjectIssuesService.updatePmsProjectIssues(id, pmsProjectIssuesInputVo);
|
||||
return success(result);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ import java.util.List;
|
|||
@ApiModel("项目工作项输入对象")
|
||||
public class PmsProjectIssuesInputVo {
|
||||
|
||||
@ApiModelProperty(value = "组织标识")
|
||||
private String enterpriseIdentifier;
|
||||
|
||||
@ApiModelProperty(value = "工作项父id")
|
||||
private Long rootId;
|
||||
|
||||
|
|
@ -64,6 +67,9 @@ public class PmsProjectIssuesInputVo {
|
|||
@NotNull
|
||||
private Integer statusId;
|
||||
|
||||
@ApiModelProperty(value = "状态 1新增 2正在解决 3已解决 4反馈 5关闭 6拒绝")
|
||||
private String statusMsg;
|
||||
|
||||
@ApiModelProperty(value = "工作项类型 1需求 2任务 3缺陷 4周报")
|
||||
private Integer pmIssueType;
|
||||
|
||||
|
|
|
|||
|
|
@ -230,4 +230,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and pms_project_id = #{projectId}
|
||||
and wiki_gitlink_repo_id is not null
|
||||
</select>
|
||||
<select id="hasChildDirById" resultType="java.lang.Boolean">
|
||||
select count(*)
|
||||
from pms_document
|
||||
where parent_id = #{documentId}
|
||||
and doc_type = 1
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue