提交修改
This commit is contained in:
commit
5bffca00ef
5
pom.xml
5
pom.xml
@ -261,6 +261,11 @@
|
||||
<artifactId>JsoupXpath</artifactId>
|
||||
<version>${jsoupXpath.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jgit</groupId>
|
||||
<artifactId>org.eclipse.jgit</artifactId>
|
||||
<version>5.1.3.201810200350-r</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@ -456,9 +456,9 @@ public class ResultRecordController extends AbstractController {
|
||||
ResultRecordDetailDto resultRecordDetailDto = new ResultRecordDetailDto();
|
||||
BeanUtils.copyProperties(resultRecord, resultRecordDetailDto);
|
||||
List<ResultModel> resultModels = resultModelService.selectResultModelByGroupId(resultRecord.getEvaluationId());
|
||||
//获取计算公式
|
||||
//获取单个人评分总分计算公式
|
||||
List<CalculateModel> calculateModels1 = getCalculate(3l);
|
||||
//获取计算公式
|
||||
//获取每行的计算公式
|
||||
List<CalculateModel> calculateModels = getCalculate(resultModels.get(0).getCalculateId());
|
||||
|
||||
|
||||
@ -467,6 +467,8 @@ public class ResultRecordController extends AbstractController {
|
||||
//查询所有参与评分人以及所占比重
|
||||
List<FlowChartDetailRecord> flowChartDetailRecords =
|
||||
flowChartDetailRecordService.selectFlowChartDetailRecordsByFlowProcess(resultRecord.getEvaluationId(), ChartFlowType.SCORE.getCode());//获取参与评分的人
|
||||
|
||||
//List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdFlowProcess(resultRecord.getId(), ChartFlowType.SCORE.getCode());
|
||||
List<StaffEntity> staffs = new ArrayList<>();
|
||||
Boolean isAllScore = true;//false表示返回所有的评分,true表示值返回评分了的人
|
||||
Boolean isOrScore = false;//是否为或签
|
||||
@ -476,7 +478,7 @@ public class ResultRecordController extends AbstractController {
|
||||
if(record.getOptType().intValue() == -1){
|
||||
//自己
|
||||
StaffEntity staffEntity = new StaffEntity();
|
||||
staffEntity.setId(resultRecord.getId());
|
||||
staffEntity.setId(resultRecord.getStaffId());
|
||||
staffEntity.setName(resultRecord.getStaffName());
|
||||
staffs1.add(staffEntity);
|
||||
}else if(record.getOptType().intValue() == 0){
|
||||
@ -514,6 +516,7 @@ public class ResultRecordController extends AbstractController {
|
||||
for (StaffEntity staff:staffs1
|
||||
) {
|
||||
ResultScoreDto resultScore = new ResultScoreDto();
|
||||
resultScore.setIsEdit(0);
|
||||
resultScore.setApprovalId(staff.getId());
|
||||
resultScore.setApprovalName(staff.getName());
|
||||
if(isOrScore){
|
||||
@ -568,7 +571,7 @@ public class ResultRecordController extends AbstractController {
|
||||
for (ResultDetailDto dto:detailDtos
|
||||
) {
|
||||
//下面设置计算公式
|
||||
dto.setCalculate(setCalculateValue(calculateModels1, dto)) ;
|
||||
//dto.setCalculate(setCalculateValue(calculateModels1, dto)) ;
|
||||
List<ResultTaskDto> resultTaskDtos = resultTaskService.selectResultTaskDtosByDetailId(dto.getId());
|
||||
dto.setTaskDtos(resultTaskDtos);
|
||||
weight = weight.add(dto.getCheckWeight());
|
||||
@ -598,6 +601,9 @@ public class ResultRecordController extends AbstractController {
|
||||
scoreDto1.setCalculate(scoreDto1.getCalculate() + setCalculateValue(calculateModels, dto)) ;
|
||||
scoreDto1.setCalculate(scoreDto1.getCalculate() + setCalculateValue(calculateModels, scoreDto1)) ;
|
||||
scoreDtos1.add(scoreDto1);
|
||||
|
||||
//设置个人评分总分的计算方式, add
|
||||
scoreDto1.setAllCalculate(setCalculateValue(calculateModels1, dto)) ;
|
||||
scores.remove(score);
|
||||
isAdd = true;
|
||||
break;
|
||||
@ -984,13 +990,14 @@ public class ResultRecordController extends AbstractController {
|
||||
|
||||
if(dto.getCommentId() != null && dto.getCommentId().intValue() > 0){
|
||||
//修改评论信息
|
||||
log.info("修改了多少个指标{}", editResultDetails.size());
|
||||
editResultDetails.addAll(resultDetailService.selectNotNoticeResultDetailByRecordId(dto.getId())) ;
|
||||
log.info("可能需要写入评论的内容条数{}", updateResultDetails.size());
|
||||
log.info("可能需要写入评论的内容条数{}", editResultDetails.size());
|
||||
//去重
|
||||
mapDetails = editResultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
|
||||
editResultDetails = mapDetails.values().stream().collect(Collectors.toList());
|
||||
if(!isSetKeyResult){
|
||||
log.info("实际需要写入评论的内容条数{}", updateResultDetails.size());
|
||||
log.info("实际需要写入评论的内容条数{}", editResultDetails.size());
|
||||
if(editResultDetails.size() > 0){
|
||||
updates.addAll(inserts);
|
||||
|
||||
@ -1001,7 +1008,7 @@ public class ResultRecordController extends AbstractController {
|
||||
for (ResultDetail resultDetail1:editResultDetails
|
||||
) {
|
||||
log.info("修改的对象为{}", resultDetail1);
|
||||
if(resultDetail1.getIsDelete().intValue() == 1){
|
||||
if(resultDetail1.getIsDelete() != null && resultDetail1.getIsDelete().intValue() == 1){
|
||||
commandValue += (commandIndex + ":(删除) 指标" + resultDetail1.getTarget() + "\n");
|
||||
commandIndex++;
|
||||
resultDetail1.setIsBack(1);
|
||||
|
||||
@ -66,4 +66,8 @@ public interface DepartmentsStaffRelateDao extends BaseMapper<DepartmentsStaffRe
|
||||
List<String> selectStaffIdsByDepartments(@Param("deparmentIds")List<String> deparmentIds);
|
||||
|
||||
List<StaffEntity> selectLeadersByDepartmentId(@Param("depId") String depId);
|
||||
|
||||
List<Long> selectLongStaffIdsByDepartments(@Param("departmentIds") List<String> departmentIds);
|
||||
|
||||
List<Long> selectAllStaffIds();
|
||||
}
|
||||
|
||||
@ -44,5 +44,9 @@ public interface DepartmentsStaffRelateService extends IService<DepartmentsStaff
|
||||
List<String> selectStaffIdsByDepartments(List<String> deparmentIds);
|
||||
|
||||
List<StaffEntity> selectLeadersByDepartmentId(String depId);
|
||||
|
||||
List<Long> selectLongStaffIdsByDepartments(List<String> departmentIds);
|
||||
|
||||
List<Long> selectAllStaffIds();
|
||||
}
|
||||
|
||||
|
||||
@ -106,4 +106,17 @@ public class DepartmentsStaffRelateServiceImpl extends ServiceImpl<DepartmentsSt
|
||||
public List<StaffEntity> selectLeadersByDepartmentId(String depId){
|
||||
return departmentsStaffRelateDao.selectLeadersByDepartmentId(depId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> selectLongStaffIdsByDepartments(List<String> departmentIds){
|
||||
if(CollectionUtils.isEmpty(departmentIds)){
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
return departmentsStaffRelateDao.selectLongStaffIdsByDepartments(departmentIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> selectAllStaffIds(){
|
||||
return departmentsStaffRelateDao.selectAllStaffIds();
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,4 +105,8 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
||||
FlowRecord selectPreFlowRecordByRecordIdMinIdStatusList(@Param("recordId") Long recordId, @Param("flowIndex") Integer flowIndex, @Param("statusList") List<Integer> statusList);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordIdFlowIndexStatusList(@Param("recordId") Long recordId, @Param("flowIndex") Integer flowIndex, @Param("statusList") List<Integer> statusList);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordIdsFlowProcess(@Param("recordIds") List<Long> recordIds, @Param("flowProcess") Long flowProcess);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordIdsStatus(@Param("recordIds") List<Long> recordIds, @Param("status") int status);
|
||||
}
|
||||
@ -39,4 +39,6 @@ public interface ResultScoreMapper extends BaseMapper<ResultScore> {
|
||||
List<ResultScore> selectResultScoresByDetailIdAndOrderByStaffIds(@Param("id") Long id, @Param("list") List<ResultScoreDto> scoreDtos);
|
||||
|
||||
int deleteResultScoreByDetailId(Long id);
|
||||
|
||||
int setNoEditScoreByDetailId(Long detailId);
|
||||
}
|
||||
@ -12,7 +12,7 @@ import java.util.Date;
|
||||
* <p>
|
||||
* </p>*业绩详情评分表
|
||||
* @author quyixiao
|
||||
* @since 2020-12-03
|
||||
* @since 2020-12-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -49,6 +49,9 @@ public class ResultScore implements java.io.Serializable {
|
||||
//根据权重计算除的实际得分
|
||||
@ApiModelProperty(value = "根据权重计算除的实际得分", name = "score")
|
||||
private BigDecimal score;
|
||||
//0未评分,1已评分
|
||||
@ApiModelProperty(value = "0未评分,1已评分", name = "isEdit")
|
||||
private Integer isEdit;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -199,6 +202,21 @@ public class ResultScore implements java.io.Serializable {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0未评分,1已评分
|
||||
* @return
|
||||
*/
|
||||
public Integer getIsEdit() {
|
||||
return isEdit;
|
||||
}
|
||||
/**
|
||||
* 0未评分,1已评分
|
||||
* @param isEdit
|
||||
*/
|
||||
public void setIsEdit(Integer isEdit) {
|
||||
this.isEdit = isEdit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ResultScore{" +
|
||||
@ -212,6 +230,7 @@ public class ResultScore implements java.io.Serializable {
|
||||
",scoreComment=" + scoreComment +
|
||||
",weight=" + weight +
|
||||
",score=" + score +
|
||||
",isEdit=" + isEdit +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -32,9 +32,7 @@ public class ResultDetailDto {
|
||||
@ApiModelProperty(value = "关键结果", name = "keyResult")
|
||||
private String keyResult;
|
||||
|
||||
//评分说明
|
||||
@ApiModelProperty(value = "计算公式", name = "calculate")
|
||||
private String calculate;
|
||||
|
||||
|
||||
//考核权重
|
||||
@ApiModelProperty(value = "考核权重", name = "checkWeight")
|
||||
|
||||
@ -37,9 +37,12 @@ public class ResultScoreDto {
|
||||
private BigDecimal weight;
|
||||
|
||||
//评分说明
|
||||
@ApiModelProperty(value = "计算公式", name = "calculate")
|
||||
@ApiModelProperty(value = "单个计算公式", name = "calculate")
|
||||
private String calculate;
|
||||
|
||||
@ApiModelProperty(value = "个人总分计算公式,不剩于多人评分中个人所占的比重", name = "allCalculate")
|
||||
private String allCalculate;
|
||||
|
||||
//评分说明
|
||||
@ApiModelProperty(value = "评分说明", name = "scoreComment")
|
||||
private String scoreComment;
|
||||
@ -47,6 +50,9 @@ public class ResultScoreDto {
|
||||
//根据权重计算除的实际得分
|
||||
@ApiModelProperty(value = "根据权重计算除的实际得分", name = "score")
|
||||
private BigDecimal score;
|
||||
|
||||
@ApiModelProperty(value = "0未评分,1已评分", name = "isEdit")
|
||||
private Integer isEdit;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
|
||||
@ -101,4 +101,8 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
||||
List<FlowRecord> selectFlowRecordByRecordIdFlowIndexStatusList(Long recordId, Integer flowIndex, List<Integer> statusList);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordIdLeFlowIndex(Long resultRecordId, Integer flowIndex);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordIdsFlowProcess(List<Long> recordIds, Long flowProcess);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordIdsStatus(List<Long> recordIds, int status);
|
||||
}
|
||||
@ -38,4 +38,6 @@ public interface ResultScoreService extends IService<ResultScore> {
|
||||
List<ResultScore> selectResultScoresByDetailIdAndOrderByStaffIds(Long id, List<ResultScoreDto> scoreDtos);
|
||||
|
||||
int deleteResultScoreByDetailId(Long id);
|
||||
|
||||
int setNoEditScoreByDetailId(Long detailId);
|
||||
}
|
||||
@ -266,4 +266,14 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
||||
return flowRecordMapper.selectFlowRecordByRecordIdLeFlowIndex(resultRecordId,flowIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlowRecord> selectFlowRecordByRecordIdsFlowProcess(List<Long> recordIds, Long flowProcess){
|
||||
return flowRecordMapper.selectFlowRecordByRecordIdsFlowProcess(recordIds,flowProcess);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlowRecord> selectFlowRecordByRecordIdsStatus(List<Long> recordIds, int status){
|
||||
return flowRecordMapper.selectFlowRecordByRecordIdsStatus(recordIds,status);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -76,6 +76,11 @@ public class ResultScoreServiceImpl extends ServiceImpl<ResultScoreMapper, Resul
|
||||
return resultScoreMapper.deleteResultScoreByDetailId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setNoEditScoreByDetailId(Long detailId){
|
||||
return resultScoreMapper.setNoEditScoreByDetailId(detailId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -17,12 +17,8 @@ import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
import com.lz.modules.app.service.StaffOccupationService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.entity.FlowChange;
|
||||
import com.lz.modules.flow.entity.FlowRecord;
|
||||
import com.lz.modules.flow.entity.FlowStart;
|
||||
import com.lz.modules.flow.service.FlowChangeService;
|
||||
import com.lz.modules.flow.service.FlowRecordService;
|
||||
import com.lz.modules.flow.service.FlowStartService;
|
||||
import com.lz.modules.flow.entity.*;
|
||||
import com.lz.modules.flow.service.*;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
|
||||
import com.lz.modules.performance.entity.TaskProcessRecord;
|
||||
@ -108,6 +104,15 @@ public class DingtalkBusiness {
|
||||
@Autowired
|
||||
private TaskProcessRecordService taskProcessRecordService;
|
||||
|
||||
@Autowired
|
||||
private StaffRoleService staffRoleService;
|
||||
|
||||
@Autowired
|
||||
private StaffRoleDepartmentService staffRoleDepartmentService;
|
||||
|
||||
@Autowired
|
||||
private StaffRoleEvaluationGroupService staffRoleEvaluationGroupService;
|
||||
|
||||
@Resource
|
||||
StaffDao staffDao;
|
||||
|
||||
@ -654,6 +659,8 @@ public class DingtalkBusiness {
|
||||
return "error";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String sendTaskInputMsg(List<StaffEntity> staffs){
|
||||
int m = 0;
|
||||
String userIds = "";
|
||||
@ -769,11 +776,6 @@ public class DingtalkBusiness {
|
||||
}
|
||||
m++;
|
||||
}
|
||||
/*for (StaffEntity info:staffEntities
|
||||
) {
|
||||
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.TASK_REPLY_COMMENT.getTitle(),
|
||||
content, WorkMsgTypeEnum.TASK_REPLY_COMMENT.getBtnText(), url, token);
|
||||
}*/
|
||||
|
||||
}
|
||||
return "OK";
|
||||
@ -982,7 +984,68 @@ public class DingtalkBusiness {
|
||||
return R.error("未授权登录");
|
||||
}
|
||||
|
||||
public void urging(List<FlowRecord> flowRecords, Map<Long, StaffEntity> mapStaffs, Map<Long, ResultRecord> mapReords) {
|
||||
ThreadSendUrgingMessage threadSendUrgingMessage = new ThreadSendUrgingMessage(flowRecords, mapReords, mapStaffs);
|
||||
Thread thread = new Thread(threadSendUrgingMessage);
|
||||
thread.start();
|
||||
|
||||
}
|
||||
|
||||
public class ThreadSendUrgingMessage implements Runnable{
|
||||
List<FlowRecord> flowRecords;
|
||||
Map<Long, ResultRecord> mapReords;
|
||||
Map<Long, StaffEntity> mapStaffs;
|
||||
public ThreadSendUrgingMessage(List<FlowRecord> flowRecords, Map<Long, ResultRecord> mapReords, Map<Long, StaffEntity> mapStaffs){
|
||||
this.flowRecords = flowRecords;
|
||||
this.mapReords = mapReords;
|
||||
this.mapStaffs = mapStaffs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
logger.info("批量催办");
|
||||
ThirdAppConfig thirdAppConfig = thirdAppConfigService.getByAppId(appid);
|
||||
String token = dingTalkUtil.getAccessTokenWitchEntity(thirdAppConfig);
|
||||
if(token != null && token.length() > 0){
|
||||
|
||||
for (FlowRecord flowRecord:flowRecords
|
||||
) {
|
||||
ResultRecord record = mapReords.get(flowRecord.getRecordId());
|
||||
StaffEntity info = mapStaffs.get(flowRecord.getApprovalStaffId());
|
||||
if(record != null && info != null){
|
||||
String url = homeUrl;
|
||||
if(url.contains("?")){
|
||||
url += "&halokit=" + System.currentTimeMillis();
|
||||
}else{
|
||||
url += "?halokit=" + System.currentTimeMillis();
|
||||
}
|
||||
url += ("&detail=1&id=" + record.getId());
|
||||
url = URLEncoder.encode(url);
|
||||
|
||||
url = "dingtalk://dingtalkclient/action/openapp?corpid=" + thirdAppConfig.getCorpId() +
|
||||
"&container_type=work_platform&app_id=0_" +
|
||||
appid + "&redirect_type=jump&redirect_url=" + url;
|
||||
|
||||
logger.info("发送消息给{},url:{}", info, url);
|
||||
String content = null;
|
||||
if(!record.getStaffName().equals(info.getName())){
|
||||
content = WorkMsgTypeEnum.URGING.getContent().replace("@", record.getStaffName());
|
||||
}else{
|
||||
content = WorkMsgTypeEnum.URGING.getContent().replace("@", "您");
|
||||
}
|
||||
|
||||
dingTalkUtil.sendSingleActionCardMSG(appid, info, WorkMsgTypeEnum.URGING.getTitle(),
|
||||
content, WorkMsgTypeEnum.URGING.getBtnText(), url, token);
|
||||
|
||||
}else{
|
||||
logger.info("无对应的record");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.info("token无效"); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ThreadSendMessage implements Runnable{
|
||||
List<StaffSimpleInfo> toStaffids;
|
||||
|
||||
@ -4,11 +4,22 @@ import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.dto.StaffSimpleDto;
|
||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||
import com.lz.modules.flow.entity.FlowRecord;
|
||||
import com.lz.modules.flow.entity.FlowStart;
|
||||
import com.lz.modules.flow.entity.StaffRole;
|
||||
import com.lz.modules.flow.entity.StaffRoleDepartment;
|
||||
import com.lz.modules.flow.service.EvaluationStartStaffService;
|
||||
import com.lz.modules.flow.service.FlowRecordService;
|
||||
import com.lz.modules.flow.service.StaffRoleDepartmentService;
|
||||
import com.lz.modules.flow.service.StaffRoleService;
|
||||
import com.lz.modules.job.business.DingtalkBusiness;
|
||||
import com.lz.modules.performance.req.AssessChangeReq;
|
||||
import com.lz.modules.performance.req.AssessListReq;
|
||||
import com.lz.modules.performance.req.AssessDetailReq;
|
||||
@ -21,13 +32,18 @@ import com.lz.modules.performance.service.AssessManagerService;
|
||||
import com.lz.modules.performance.service.ChartResultService;
|
||||
import com.lz.modules.sys.controller.AbstractController;
|
||||
import com.lz.modules.sys.dao.app.ResultRecordMapper;
|
||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
@ -51,6 +67,24 @@ public class AssessManagerController extends AbstractController{
|
||||
@Autowired
|
||||
private StaffRoleService staffRoleService;
|
||||
|
||||
@Autowired
|
||||
private DingtalkBusiness dingtalkBusiness;
|
||||
|
||||
@Autowired
|
||||
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||
|
||||
@Autowired
|
||||
private StaffRoleDepartmentService staffRoleDepartmentService;
|
||||
|
||||
@Autowired
|
||||
private DepartmentsService departmentsService;
|
||||
|
||||
@Autowired
|
||||
private StaffService staffService;
|
||||
|
||||
@Autowired
|
||||
private FlowRecordService flowRecordService;
|
||||
|
||||
|
||||
|
||||
@PostMapping("assess/manager/list")
|
||||
@ -157,4 +191,155 @@ public class AssessManagerController extends AbstractController{
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("assess/manager/Urging")
|
||||
@ApiOperation("一键催办")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功")})
|
||||
public R assessToScore(@RequestParam Map<String, String> params){
|
||||
log.info("接受的至{}", params);
|
||||
Long startId = Long.parseLong(params.get("startId"));
|
||||
Long flowProcess = null;
|
||||
if(params.containsKey("flowProcess")){
|
||||
flowProcess = Long.parseLong(params.get("flowProcess"));
|
||||
}
|
||||
|
||||
try {
|
||||
Long userId = getUserId();
|
||||
log.info("一键催办" + userId);
|
||||
StaffRole staffRole = staffRoleService.selectByStaffId(userId);
|
||||
int isManagementDepartment = 0;
|
||||
List<String> departmentIds = new ArrayList<>();
|
||||
if(staffRole != null){
|
||||
//查询管理的部门信息
|
||||
if(staffRole.getDepartmentId().intValue() == 2){//管理特定部门
|
||||
List<StaffRoleDepartment> staffRoleDepartments =
|
||||
staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
||||
if(staffRoleDepartments.size() > 0){
|
||||
departmentIds.addAll(staffRoleDepartments.stream().map(new Function<StaffRoleDepartment, String>() {
|
||||
@Override
|
||||
public String apply(StaffRoleDepartment staffRoleDepartment) {
|
||||
return staffRoleDepartment.getDepartmentId();
|
||||
}
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
}else if(staffRole.getDepartmentId().intValue() == 1){
|
||||
//管理所在部门及子部门
|
||||
isManagementDepartment = 1;//所在部门及子部门
|
||||
}else if(staffRole.getDepartmentId().intValue() == 0){
|
||||
isManagementDepartment = 2;//所有部门
|
||||
}
|
||||
|
||||
}
|
||||
List<Long> staffIds = null;
|
||||
if(isManagementDepartment == 2){
|
||||
//管理所有部门
|
||||
log.info("管理所有部门");
|
||||
staffIds = departmentsStaffRelateService.selectAllStaffIds();
|
||||
}else{
|
||||
//看下是否为部门领导
|
||||
log.info("管理所指定部门");
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity
|
||||
= departmentsStaffRelateService.selectByStaffId(userId);
|
||||
if (departmentsStaffRelateEntity != null && (isManagementDepartment == 1 ||
|
||||
departmentsStaffRelateEntity.getIsLeader().intValue() == 1)) {//特定部门的
|
||||
//获取所在部门下面的所有人员id
|
||||
departmentIds.add(departmentsStaffRelateEntity.getDepartmentId());
|
||||
}
|
||||
if(departmentIds.size() > 0){
|
||||
//去重
|
||||
log.info("去重前数据{}", departmentIds.size());
|
||||
departmentIds = departmentIds.stream().distinct().collect(Collectors.toList());
|
||||
log.info("去重后数据{}", departmentIds.size());
|
||||
|
||||
List<String> childIds = new ArrayList<>();
|
||||
//获取子部门信息
|
||||
for (String pareId:departmentIds
|
||||
) {
|
||||
childIds.addAll(getChildsId(pareId));
|
||||
}
|
||||
if(childIds.size() > 0){
|
||||
departmentIds.addAll(childIds);
|
||||
}
|
||||
}
|
||||
//根据部门获取所有员工的id
|
||||
staffIds = departmentsStaffRelateService.selectLongStaffIdsByDepartments(departmentIds);
|
||||
}
|
||||
|
||||
log.info("查询到有权限可以推送的人员数量为{}, 如下{}", staffIds.size(), staffIds);
|
||||
//下面查询当前startId,当前flowProcess下面有多少人员id
|
||||
List<ResultRecord> resultRecords = resultRecordMapper.selectStaffIdsByStartIdAndFlowProcess(startId, flowProcess);
|
||||
Map<Long, ResultRecord> mapReords =
|
||||
resultRecords.stream().collect(Collectors.toMap(ResultRecord::getStaffId, Function.identity(), (e, r) -> e));
|
||||
|
||||
List<Long> staffIds1 = mapReords.keySet().stream().collect(Collectors.toList());
|
||||
log.info("查询到在当前节点下的人数为{},如下{}", staffIds1.size(), staffIds1);
|
||||
if(staffIds1.size() > 0 && staffIds.size() > 0){
|
||||
staffIds.retainAll(staffIds1);//求交集
|
||||
log.info("需要推送绩效个数{}", staffIds.size());
|
||||
if(staffIds.size() > 0){
|
||||
|
||||
staffIds1 = mapReords.keySet().stream().collect(Collectors.toList());
|
||||
staffIds1.retainAll(staffIds);
|
||||
log.info("去掉排除的数据后数量{}", staffIds1.size());
|
||||
for (Long id:staffIds1
|
||||
) {
|
||||
mapReords.remove(id);
|
||||
}
|
||||
//获取催办的节点的人员信息
|
||||
List<Long> recordIds = resultRecords.stream().map(new Function<ResultRecord, Long>() {
|
||||
@Override
|
||||
public Long apply(ResultRecord resultRecord) {
|
||||
return resultRecord.getId();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
log.info("剩余需要处理record的数量{}", recordIds.size());
|
||||
List<FlowRecord> flowRecords;
|
||||
if(flowProcess == null){//催全部,获取当前节点的人员信息
|
||||
|
||||
flowRecords =
|
||||
flowRecordService.selectFlowRecordByRecordIdsStatus(recordIds, 2);
|
||||
log.info("催当前节点的人员,数量{}", flowRecords.size());
|
||||
}else{
|
||||
flowRecords =
|
||||
flowRecordService.selectFlowRecordByRecordIdsFlowProcess(recordIds, flowProcess);
|
||||
log.info("催指定节点的人员,数量{}", flowRecords.size());
|
||||
}
|
||||
|
||||
staffIds = flowRecords.stream().map(new Function<FlowRecord, Long>() {
|
||||
@Override
|
||||
public Long apply(FlowRecord flowRecord) {
|
||||
return flowRecord.getApprovalStaffId();
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
log.info("最终能推送人员个数{}", staffIds.size());
|
||||
mapReords = resultRecords.stream().collect(Collectors.toMap(ResultRecord::getId, Function.identity(), (e, r) -> e));
|
||||
List<StaffEntity> staffEntities = staffService.selectByIds(staffIds);
|
||||
Map<Long, StaffEntity> mapStaffs = staffEntities.stream().collect(Collectors.toMap(StaffEntity::getId, Function.identity(), (e, r) -> e));
|
||||
dingtalkBusiness.urging(flowRecords, mapStaffs, mapReords);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("开始评分异常" ,e);
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
//获取部门下面的所有子部门信息
|
||||
private List<String> getChildsId(String pareId){
|
||||
log.info("查询{}的子部门", pareId);
|
||||
List<String> ids = new ArrayList<>();
|
||||
List<DepartmentsEntity> entitys = departmentsService.selectEntityByParentDepartmentId(pareId);
|
||||
if(entitys.size() > 0){
|
||||
for (DepartmentsEntity entity:entitys
|
||||
) {
|
||||
List<String> childsId = getChildsId(entity.getDepartmentId());
|
||||
if(childsId.size() > 0){
|
||||
ids.addAll(childsId);
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("子部门个数{}", ids.size());
|
||||
return ids;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,15 +2,11 @@ package com.lz.modules.performance.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.XmlUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import cn.hutool.poi.excel.StyleSet;
|
||||
import com.alibaba.druid.sql.visitor.functions.If;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.lz.common.utils.HttpUtil;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.model.ResultDetailDto;
|
||||
@ -23,21 +19,12 @@ import com.lz.modules.performance.req.ChartResultReq;
|
||||
import com.lz.modules.performance.res.LevelDetailExportRes;
|
||||
import com.lz.modules.performance.service.ChartResultService;
|
||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||
import com.sun.deploy.net.HttpUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.http.HeaderElement;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.entity.GzipDecompressingEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.utils.HttpClientUtils;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.seimicrawler.xpath.JXDocument;
|
||||
import org.seimicrawler.xpath.JXNode;
|
||||
import org.slf4j.Logger;
|
||||
@ -47,10 +34,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.util.HtmlUtils;
|
||||
import org.w3c.dom.Document;
|
||||
import sun.net.www.http.HttpClient;
|
||||
import sun.plugin2.os.windows.Windows;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@ -62,7 +45,6 @@ import java.math.BigDecimal;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -434,86 +416,7 @@ public class ExportController {
|
||||
" }*/
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
//域名
|
||||
String domain = "";
|
||||
//项目名
|
||||
String projectName = "";
|
||||
//分支名
|
||||
String branchName = "";
|
||||
//session
|
||||
String session = "";
|
||||
//分页 ?limit=40&offset=120
|
||||
|
||||
|
||||
|
||||
try {
|
||||
URLConnection urlConnection = new URL("http://gitlab.ldxinyong.com/enterpriseManagement/lz_management/commits/version_performance_2.0").openConnection();
|
||||
//URLConnection urlConnection = new URL("http://gitlab.ldxinyong.com/enterpriseManagement/lz_management/graphs/master").openConnection();
|
||||
HttpURLConnection connection = (HttpURLConnection) urlConnection;
|
||||
connection.setRequestMethod("GET");
|
||||
connection.addRequestProperty("Host", "gitlab.ldxinyong.com");
|
||||
|
||||
connection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0");
|
||||
|
||||
connection.addRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
connection.addRequestProperty("Accept-Encoding", "gzip, deflate");
|
||||
connection.addRequestProperty("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
|
||||
connection.addRequestProperty("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22");
|
||||
|
||||
//connection.addRequestProperty("Referer", "http://gitlab.ldxinyong.com/enterpriseManagement/lz_management/commits/master");
|
||||
|
||||
//connection.addRequestProperty("Connection", "keep-alive");
|
||||
|
||||
//connection.addRequestProperty("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
//connection.addRequestProperty("If-None-Match", "W/\"352c90856827b53f3735109727c9f3a1\"");
|
||||
|
||||
connection.addRequestProperty("Cookie", "_gitlab_session=4e14c53a8cb378a65fda996b0bc15021; sidebar_collapsed=false");
|
||||
connection.connect();// 连接会话
|
||||
// 获取输入流
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
|
||||
String line;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while ((line = br.readLine()) != null) {// 循环读取流
|
||||
sb.append(line);
|
||||
}
|
||||
br.close();// 关闭流
|
||||
connection.disconnect();// 断开连接
|
||||
System.out.println(sb.toString());
|
||||
JXDocument document = JXDocument.create(sb.toString());
|
||||
JXNode jxNode = document.selNOne("//*[@id='commits-list']");
|
||||
List<JXNode> sel = jxNode.sel("//*[@class='commits-row']");
|
||||
for(JXNode jx:sel){
|
||||
List<JXNode> sel2 = jx.sel("//*[@class='commit flex-row js-toggle-container']");
|
||||
for(JXNode j:sel2){
|
||||
String avatar = j.sel("//img[@class='avatar s36 hidden-xs has-tooltip']/@src").get(0).toString();
|
||||
System.out.println("头像 " + avatar);
|
||||
|
||||
String commit = j.sel("//a[@class='commit-row-message item-title']/text()").get(0).toString();
|
||||
System.out.println("摘要 " + commit);
|
||||
|
||||
String name = j.sel("//a[@class='commit-author-link has-tooltip']/text()").get(0).toString();
|
||||
System.out.println("姓名 " + name);
|
||||
|
||||
String time = j.sel("//time[@class='js-timeago']/@datetime").get(0).toString();
|
||||
System.out.println("时间 " + time);
|
||||
|
||||
|
||||
String version = j.sel("//div[@class='label label-monospace']/text()").get(0).toString();
|
||||
System.out.println("版本 " + version);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,235 @@
|
||||
package com.lz.modules.performance.controller;
|
||||
|
||||
import org.eclipse.jgit.api.CloneCommand;
|
||||
import org.eclipse.jgit.api.Git;
|
||||
import org.eclipse.jgit.api.LogCommand;
|
||||
import org.eclipse.jgit.api.PullResult;
|
||||
import org.eclipse.jgit.diff.DiffEntry;
|
||||
import org.eclipse.jgit.internal.storage.file.FileRepository;
|
||||
import org.eclipse.jgit.lib.ObjectReader;
|
||||
import org.eclipse.jgit.lib.PersonIdent;
|
||||
import org.eclipse.jgit.revwalk.RevCommit;
|
||||
import org.eclipse.jgit.revwalk.RevTree;
|
||||
import org.eclipse.jgit.revwalk.RevWalk;
|
||||
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
|
||||
import org.eclipse.jgit.treewalk.AbstractTreeIterator;
|
||||
import org.eclipse.jgit.treewalk.CanonicalTreeParser;
|
||||
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
|
||||
import org.seimicrawler.xpath.JXDocument;
|
||||
import org.seimicrawler.xpath.JXNode;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
* @Desc:
|
||||
* @Date: 2020/12/17 17:06
|
||||
*/
|
||||
public class GitController {
|
||||
|
||||
|
||||
/*public static void main(String[] args) throws Exception{
|
||||
|
||||
|
||||
//设置远程服务器上的用户名和密码
|
||||
UsernamePasswordCredentialsProvider usernamePasswordCredentialsProvider =new
|
||||
UsernamePasswordCredentialsProvider("dujianchao31","Du1262707462");
|
||||
//克隆代码库命令
|
||||
CloneCommand cloneCommand = Git.cloneRepository();
|
||||
|
||||
Git git= cloneCommand.setURI("http://gitlab.ldxinyong.com/enterpriseManagement/lz_management/") //设置远程URI
|
||||
.setBranch("version_performance_2.0") //设置clone下来的分支
|
||||
.setDirectory(new File("D:\\test\\")) //设置下载存放路径
|
||||
.setCredentialsProvider(usernamePasswordCredentialsProvider) //设置权限验证
|
||||
.call();
|
||||
}*/
|
||||
|
||||
public static void main(String[] args) throws Exception{
|
||||
UsernamePasswordCredentialsProvider usernamePasswordCredentialsProvider =new
|
||||
UsernamePasswordCredentialsProvider("dujianchao31","Du1262707462");
|
||||
/* //git仓库地址
|
||||
Git git = new Git(new FileRepository("D:\\test\\"+"/.git"));
|
||||
PullResult call = git.pull().setRemoteBranchName("version_performance_2.0").
|
||||
setCredentialsProvider(usernamePasswordCredentialsProvider).call();*/
|
||||
|
||||
//git仓库地址
|
||||
Git git = new Git(new FileRepository("D:\\test\\"+"/.git"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static AbstractTreeIterator prepareTreeParser(RevCommit commit){
|
||||
System.out.println(commit.getId());
|
||||
try (RevWalk walk = new RevWalk(new FileRepository("D:\\test\\"+"/.git"))) {
|
||||
System.out.println(commit.getTree().getId());
|
||||
RevTree tree = walk.parseTree(commit.getTree().getId());
|
||||
|
||||
CanonicalTreeParser oldTreeParser = new CanonicalTreeParser();
|
||||
try (ObjectReader oldReader = new FileRepository("D:\\test\\"+"/.git").newObjectReader()) {
|
||||
oldTreeParser.reset(oldReader, tree.getId());
|
||||
}
|
||||
|
||||
walk.dispose();
|
||||
|
||||
return oldTreeParser;
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//日志信息
|
||||
|
||||
public static void commit(Git git) throws Exception{
|
||||
List<String> versions = new ArrayList<>();
|
||||
Iterable<RevCommit> commits = git.log().all().call();
|
||||
int count = 0;
|
||||
for (RevCommit commit : commits) {
|
||||
System.out.println("LogCommit: " + commit);
|
||||
System.out.println("提交信息:" + commit.getFullMessage());
|
||||
String version = commit.getName(); //版本号,用来查询详细信息
|
||||
versions.add(version);
|
||||
System.out.println("版本号:" + commit.getName());
|
||||
PersonIdent authorIdent = commit.getAuthorIdent();
|
||||
System.out.println("作者:" + authorIdent.getName());
|
||||
System.out.println("邮箱:" + authorIdent.getEmailAddress());
|
||||
System.out.println("时间:" + authorIdent.getWhen());
|
||||
count++;
|
||||
}
|
||||
System.out.println("=========");
|
||||
System.out.println("总计" + count);
|
||||
}
|
||||
|
||||
|
||||
//文件变动
|
||||
public void diff(Git git) throws Exception{
|
||||
List<RevCommit> commitsList = new ArrayList<>();
|
||||
Iterable<RevCommit> commits = git.log().all().call();
|
||||
for(RevCommit commit:commits){
|
||||
commitsList.add(commit);
|
||||
}
|
||||
|
||||
AbstractTreeIterator newTree = prepareTreeParser(commitsList.get(0));
|
||||
AbstractTreeIterator oldTree = prepareTreeParser(commitsList.get(1));
|
||||
|
||||
List<DiffEntry> diffEntries = git.diff().setNewTree(newTree).setOldTree(oldTree).call();
|
||||
DiffEntry.ChangeType changeType;
|
||||
int add =0;
|
||||
int copy =0;
|
||||
int delete =0;
|
||||
int modify =0;
|
||||
int rename =0;
|
||||
for(DiffEntry entry : diffEntries){
|
||||
changeType = entry.getChangeType();
|
||||
System.out.println("=====" + changeType);
|
||||
switch (changeType) {
|
||||
case ADD:
|
||||
System.out.println(++add);
|
||||
break;
|
||||
case COPY:
|
||||
System.out.println(++copy);
|
||||
break;
|
||||
case DELETE:
|
||||
System.out.println(++delete);
|
||||
break;
|
||||
case MODIFY:
|
||||
System.out.println(++modify);
|
||||
break;
|
||||
case RENAME:
|
||||
System.out.println(rename++);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("=========");
|
||||
}
|
||||
|
||||
public void webTest(){
|
||||
//域名
|
||||
String domain = "";
|
||||
//项目名
|
||||
String projectName = "";
|
||||
//分支名
|
||||
String branchName = "";
|
||||
//session
|
||||
String session = "";
|
||||
//分页 ?limit=40&offset=120
|
||||
|
||||
try {
|
||||
URLConnection urlConnection = new URL("http://gitlab.ldxinyong.com/enterpriseManagement/lz_management/commits/version_performance_2.0").openConnection();
|
||||
//URLConnection urlConnection = new URL("http://gitlab.ldxinyong.com/enterpriseManagement/lz_management/graphs/master").openConnection();
|
||||
HttpURLConnection connection = (HttpURLConnection) urlConnection;
|
||||
connection.setRequestMethod("GET");
|
||||
connection.addRequestProperty("Host", "gitlab.ldxinyong.com");
|
||||
|
||||
connection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0");
|
||||
|
||||
connection.addRequestProperty("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
connection.addRequestProperty("Accept-Encoding", "gzip, deflate");
|
||||
connection.addRequestProperty("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
|
||||
connection.addRequestProperty("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.160 Safari/537.22");
|
||||
|
||||
//connection.addRequestProperty("Referer", "http://gitlab.ldxinyong.com/enterpriseManagement/lz_management/commits/master");
|
||||
|
||||
//connection.addRequestProperty("Connection", "keep-alive");
|
||||
|
||||
//connection.addRequestProperty("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
//connection.addRequestProperty("If-None-Match", "W/\"352c90856827b53f3735109727c9f3a1\"");
|
||||
|
||||
connection.addRequestProperty("Cookie", "_gitlab_session=4e14c53a8cb378a65fda996b0bc15021; sidebar_collapsed=false");
|
||||
connection.connect();// 连接会话
|
||||
// 获取输入流
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
|
||||
String line;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while ((line = br.readLine()) != null) {// 循环读取流
|
||||
sb.append(line);
|
||||
}
|
||||
br.close();// 关闭流
|
||||
connection.disconnect();// 断开连接
|
||||
System.out.println(sb.toString());
|
||||
JXDocument document = JXDocument.create(sb.toString());
|
||||
JXNode jxNode = document.selNOne("//*[@id='commits-list']");
|
||||
List<JXNode> sel = jxNode.sel("//*[@class='commits-row']");
|
||||
for(JXNode jx:sel){
|
||||
List<JXNode> sel2 = jx.sel("//*[@class='commit flex-row js-toggle-container']");
|
||||
for(JXNode j:sel2){
|
||||
String avatar = j.sel("//img[@class='avatar s36 hidden-xs has-tooltip']/@src").get(0).toString();
|
||||
System.out.println("头像 " + avatar);
|
||||
|
||||
String commit = j.sel("//a[@class='commit-row-message item-title']/text()").get(0).toString();
|
||||
System.out.println("摘要 " + commit);
|
||||
|
||||
String name = j.sel("//a[@class='commit-author-link has-tooltip']/text()").get(0).toString();
|
||||
System.out.println("姓名 " + name);
|
||||
|
||||
String time = j.sel("//time[@class='js-timeago']/@datetime").get(0).toString();
|
||||
System.out.println("时间 " + time);
|
||||
|
||||
|
||||
String version = j.sel("//div[@class='label label-monospace']/text()").get(0).toString();
|
||||
System.out.println("版本 " + version);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -114,4 +114,5 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
||||
|
||||
List<Long> selectStaffIdsByFlowProcess(@Param("flowProcess") List<Integer> flowProcess);
|
||||
|
||||
List<ResultRecord> selectStaffIdsByStartIdAndFlowProcess(@Param("startId") Long startId, @Param("flowProcess") Long flowProcess);
|
||||
}
|
||||
@ -128,7 +128,10 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
||||
|
||||
R getResetData(RecordDetailDto recordDetailDto);
|
||||
|
||||
|
||||
/**
|
||||
* clearFlag == 0 全清 1 部分清 2只清楚评分标志
|
||||
*
|
||||
* */
|
||||
R resetData(Long recordId, int clearFlag);
|
||||
|
||||
List<Long> selectStaffIdsByFlowProcess(List<Integer> flowProcess);
|
||||
|
||||
@ -979,6 +979,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
}
|
||||
}
|
||||
resultRecordService.resetData(resultRecord.getId(),2);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -1500,6 +1501,11 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
return R.ok().put("data",resetDataResps);
|
||||
}
|
||||
|
||||
//删除指标信息
|
||||
/**
|
||||
* clearFlag == 0 全清 1 部分清包括评分标志 2只清楚评分标志
|
||||
*
|
||||
* */
|
||||
@Override
|
||||
public R resetData(Long recordId, int clearFlag) {
|
||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordId);
|
||||
@ -1517,12 +1523,18 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
//删除指标以外的所有数据,评分、评分说明、结果
|
||||
|
||||
for(ResultDetail detail : resultDetails){
|
||||
detail.setCheckResult(null);
|
||||
detail.setAcquireScore(null);
|
||||
detail.setSuperScore(null);
|
||||
resultScoreService.deleteResultScoreByDetailId(detail.getId());
|
||||
if(clearFlag == 1){
|
||||
detail.setCheckResult(null);
|
||||
detail.setAcquireScore(null);
|
||||
detail.setSuperScore(null);
|
||||
resultScoreService.deleteResultScoreByDetailId(detail.getId());
|
||||
}else{
|
||||
resultScoreService.setNoEditScoreByDetailId(detail.getId());
|
||||
}
|
||||
|
||||
}
|
||||
resultDetailService.updateBatchById(resultDetails);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("无数据删除");
|
||||
|
||||
@ -653,5 +653,11 @@
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="selectStaffIdsByStartIdAndFlowProcess" resultType="ResultRecord">
|
||||
select * from lz_result_record where is_delete = 0 and start_id = #{startId}
|
||||
<if test="flowProcess != null"> and flow_process = #{flowProcess}</if>
|
||||
<if test="flowProcess != null"> and flow_process <![CDATA[<]]> 4</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -280,7 +280,7 @@
|
||||
</update>
|
||||
|
||||
<select id="selectFlowRecordByRecordIdFlowProcess" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||
select * from lz_flow_record where is_delete = 0 and record_id = #{id} and flow_process = #{flowProcess}
|
||||
select * from lz_flow_record where is_delete = 0 and record_id = #{id} and flow_process = #{flowProcess} order by flow_index asc
|
||||
</select>
|
||||
|
||||
|
||||
@ -364,5 +364,25 @@
|
||||
update lz_flow_record set id = #{newId} where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectFlowRecordByRecordIdsFlowProcess" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||
select * from lz_flow_record where is_delete = 0
|
||||
and record_id in
|
||||
<foreach item="recordId" collection="recordIds" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
and flow_process = #{flowProcess}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectFlowRecordByRecordIdsStatus" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||
select * from lz_flow_record where is_delete = 0
|
||||
and record_id in
|
||||
<foreach item="recordId" collection="recordIds" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
and status = #{status}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -14,12 +14,13 @@
|
||||
<result column="score_comment" property="scoreComment"/>
|
||||
<result column="weight" property="weight"/>
|
||||
<result column="score" property="score"/>
|
||||
<result column="is_edit" property="isEdit"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, acquire_score AS acquireScore, detail_id AS detailId, approval_id AS approvalId, score_comment AS scoreComment, weight AS weight, score AS score
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, acquire_score AS acquireScore, detail_id AS detailId, approval_id AS approvalId, score_comment AS scoreComment, weight AS weight, score AS score, is_edit AS isEdit
|
||||
</sql>
|
||||
|
||||
|
||||
@ -38,6 +39,7 @@
|
||||
<if test="scoreComment != null">score_comment, </if>
|
||||
<if test="weight != null">weight, </if>
|
||||
<if test="score != null">score, </if>
|
||||
<if test="isEdit != null">is_edit, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
@ -48,6 +50,7 @@
|
||||
<if test="scoreComment != null">#{ scoreComment}, </if>
|
||||
<if test="weight != null">#{ weight}, </if>
|
||||
<if test="score != null">#{ score}, </if>
|
||||
<if test="isEdit != null">#{ isEdit}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
@ -66,7 +69,8 @@
|
||||
<if test="approvalId != null">approval_id = #{approvalId},</if>
|
||||
<if test="scoreComment != null">score_comment = #{scoreComment},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="score != null">score = #{score}</if>
|
||||
<if test="score != null">score = #{score},</if>
|
||||
<if test="isEdit != null">is_edit = #{isEdit}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
@ -84,7 +88,8 @@
|
||||
approval_id = #{approvalId},
|
||||
score_comment = #{scoreComment},
|
||||
weight = #{weight},
|
||||
score = #{score}
|
||||
score = #{score},
|
||||
is_edit = #{isEdit}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -110,5 +115,9 @@
|
||||
update lz_result_score set is_delete = 1, gmt_modified = now() where detail_id=#{id} and is_delete = 0
|
||||
</update>
|
||||
|
||||
<update id="setNoEditScoreByDetailId" parameterType="java.lang.Long">
|
||||
update lz_result_score set is_edit = 0, gmt_modified = now() where detail_id=#{id} and is_delete = 0
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -109,4 +109,17 @@
|
||||
select staff.* from lz_staff as staff join lz_departments_staff_relate as relate on staff.id = relate.staff_id
|
||||
where relate.is_delete=0 and relate.department_id = #{depId} and relate.is_leader = 1
|
||||
</select>
|
||||
|
||||
<select id="selectLongStaffIdsByDepartments" resultType="Long">
|
||||
SELECT staff_id from lz_departments_staff_relate where is_delete = 0 and
|
||||
department_id in
|
||||
<foreach collection="departmentIds" item="department_id" open="(" close=")"
|
||||
separator=",">
|
||||
#{department_id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectAllStaffIds" resultType="Long">
|
||||
select staff_id from lz_departments_staff_relate where is_delete = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
<if test="token != null">#{token},</if>
|
||||
<if test="expireTime != null">#{expireTime},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="tokenCode != null">tokenCode,</if>
|
||||
<if test="codeTime != null">codeTime,</if>
|
||||
<if test="tokenCode != null">#{tokenCode},</if>
|
||||
<if test="codeTime != null">#{codeTime},</if>
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
@ -85,7 +85,7 @@ public class MysqlMain {
|
||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||
|
||||
|
||||
list.add(new TablesBean("lz_task_process_record"));
|
||||
list.add(new TablesBean("lz_result_score"));
|
||||
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user