29 changed files with 1908 additions and 1935 deletions
@ -0,0 +1,24 @@ |
|||||
|
package com.ccsens.ptos_zero.annotation; |
||||
|
|
||||
|
import java.lang.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @description: 用于标识方法需要登录,获取userId |
||||
|
* 如果未登录,直接返回用户未登录 |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 09:48 |
||||
|
*/ |
||||
|
@Documented |
||||
|
@Retention(RetentionPolicy.RUNTIME) |
||||
|
@Target(ElementType.METHOD) |
||||
|
public @interface MustLogin { |
||||
|
/** |
||||
|
* -1 不处理 |
||||
|
* 0: 数组 |
||||
|
* 1:List |
||||
|
* 2:Set |
||||
|
* 3: Map |
||||
|
* */ |
||||
|
byte type() default -1; |
||||
|
|
||||
|
} |
@ -0,0 +1,102 @@ |
|||||
|
package com.ccsens.ptos_zero.api; |
||||
|
|
||||
|
import com.ccsens.ptos_zero.annotation.MustLogin; |
||||
|
import com.ccsens.ptos_zero.bean.dto.DeliverDto; |
||||
|
import com.ccsens.ptos_zero.bean.vo.DeliverVo; |
||||
|
import com.ccsens.ptos_zero.service.IDeliverService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author AUSU |
||||
|
*/ |
||||
|
@Api(tags = "交付物相关" ) |
||||
|
@RestController |
||||
|
@RequestMapping("/deliver") |
||||
|
@Slf4j |
||||
|
public class DeliverController { |
||||
|
|
||||
|
@Resource |
||||
|
private IDeliverService deliverService; |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "查询所有成员", notes = "") |
||||
|
@RequestMapping(value = "/queryChecker", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<List<DeliverVo.Checker>> queryChecker(@ApiParam @Validated @RequestBody QueryDto<DeliverDto.QueryChecker> params) throws Exception{ |
||||
|
log.info("查询所有成员--{}",params); |
||||
|
List<DeliverVo.Checker> checkers = deliverService.queryChecker(params.getParam(), params.getUserId()); |
||||
|
log.info("返回所有成员--{}",checkers); |
||||
|
return JsonResponse.newInstance().ok(checkers); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "修改交付物标题名称(给任务添加交付物)", notes = "") |
||||
|
@RequestMapping(value = "/saveDeliver", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse saveDeliver(@ApiParam @Validated @RequestBody QueryDto<DeliverDto.SaveDeliver> params) throws Exception{ |
||||
|
log.info("给任务添加交付物--{}",params); |
||||
|
deliverService.saveDeliver(params.getParam(), params.getUserId()); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "查看任务下的交付物", notes = "") |
||||
|
@RequestMapping(value = "/getDeliver", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<DeliverVo.DeliverOfTask> getDeliver(@ApiParam @Validated @RequestBody QueryDto<DeliverDto.GetTaskDeliver> params) throws Exception{ |
||||
|
log.info("查看任务下的交付物--{}",params); |
||||
|
DeliverVo.DeliverOfTask deliverOfTask = deliverService.getDeliver(params.getParam(), params.getUserId()); |
||||
|
log.info("任务下的交付物信息--{}",deliverOfTask); |
||||
|
return JsonResponse.newInstance().ok(deliverOfTask); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "提交交付物信息", notes = "") |
||||
|
@RequestMapping(value = "/submitDeliver", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse submitDeliver(@ApiParam @Validated @RequestBody QueryDto<DeliverDto.SubmitDeliver> params) throws Exception{ |
||||
|
log.info("查看任务下的交付物--{}",params); |
||||
|
deliverService.submitDeliver(params.getParam(), params.getUserId()); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "检查交付物", notes = "") |
||||
|
@RequestMapping(value = "/checkDeliver", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse checkDeliver(@ApiParam @Validated @RequestBody QueryDto<DeliverDto.CheckDeliver> params) throws Exception{ |
||||
|
log.info("查看任务下的交付物--{}",params); |
||||
|
deliverService.checkDeliver(params.getParam(), params.getUserId()); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "查看交付物上传记录", notes = "查看所有记录倒叙查看") |
||||
|
@RequestMapping(value = "/queryRecord", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<DeliverVo.QueryDeliverRecord> queryRecord(@ApiParam @Validated @RequestBody QueryDto<DeliverDto.QueryRecord> params) throws Exception{ |
||||
|
log.info("查看交付物上传记录--{}",params); |
||||
|
DeliverVo.QueryDeliverRecord queryDeliverRecord = deliverService.queryRecord(params.getParam(), params.getUserId()); |
||||
|
log.info("返回交付物上传记录"); |
||||
|
return JsonResponse.newInstance().ok(queryDeliverRecord); |
||||
|
} |
||||
|
|
||||
|
@MustLogin |
||||
|
@ApiOperation(value = "查看本次提交的交付物的所有审核记录", notes = "查看所有记录倒叙查看") |
||||
|
@RequestMapping(value = "/queryCheckLog", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<List<DeliverVo.CheckerInfo>> queryCheckLog(@ApiParam @Validated @RequestBody QueryDto<DeliverDto.QueryCheckLog> params) throws Exception{ |
||||
|
log.info("查看交付物上传记录--{}",params); |
||||
|
List<DeliverVo.CheckerInfo> checkerInfos = deliverService.queryCheckLog(params.getParam(), params.getUserId()); |
||||
|
log.info("交付物上传记录--{}",checkerInfos); |
||||
|
return JsonResponse.newInstance().ok(checkerInfos); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,136 @@ |
|||||
|
package com.ccsens.ptos_zero.aspect; |
||||
|
|
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import com.ccsens.ptos_zero.annotation.MustLogin; |
||||
|
import com.ccsens.ptos_zero.bean.po.ProUser; |
||||
|
import com.ccsens.ptos_zero.persist.dao.UserDao; |
||||
|
import com.ccsens.ptos_zero.util.Constant; |
||||
|
import com.ccsens.util.CodeEnum; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.WebConstant; |
||||
|
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import com.ccsensptos.tallsdk.bean.dto.TallTokenDto; |
||||
|
import com.ccsensptos.tallsdk.bean.vo.TallTokenVo; |
||||
|
import com.ccsensptos.tallsdk.util.TokenUtil; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.aspectj.lang.ProceedingJoinPoint; |
||||
|
import org.aspectj.lang.Signature; |
||||
|
import org.aspectj.lang.annotation.Around; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.aspectj.lang.annotation.Pointcut; |
||||
|
import org.aspectj.lang.reflect.MethodSignature; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.core.annotation.Order; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.web.context.request.RequestContextHolder; |
||||
|
import org.springframework.web.context.request.ServletRequestAttributes; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import java.lang.reflect.Array; |
||||
|
import java.lang.reflect.Method; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: wuHuiJuan |
||||
|
* @create: 2019/12/09 09:54 |
||||
|
*/ |
||||
|
@Order(0) |
||||
|
@Slf4j |
||||
|
@Aspect |
||||
|
@Component |
||||
|
public class MustLoginAspect { |
||||
|
@Resource |
||||
|
private UserDao userDao; |
||||
|
|
||||
|
@Pointcut("@annotation(com.ccsens.ptos_zero.annotation.MustLogin)") |
||||
|
public void loginAdvice(){} |
||||
|
|
||||
|
@Around("loginAdvice()") |
||||
|
public Object around(ProceedingJoinPoint pjp) throws Throwable { |
||||
|
|
||||
|
HttpServletRequest request = ((ServletRequestAttributes) |
||||
|
RequestContextHolder.getRequestAttributes()).getRequest(); |
||||
|
|
||||
|
final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN); |
||||
|
|
||||
|
Object[] args = pjp.getArgs(); |
||||
|
QueryDto dto = args == null || args.length < 1 ? null : (QueryDto) args[0]; |
||||
|
|
||||
|
//获取userId
|
||||
|
ProUser user = null; |
||||
|
if(StrUtil.isNotEmpty(authHeader)){ |
||||
|
log.info("MustLogin————token:{}", authHeader); |
||||
|
//通过token查找用户信息
|
||||
|
//TODO 根据token获取用户信息
|
||||
|
TallTokenVo.UserIdByToken userByToken = TokenUtil.getUserByToken(new TallTokenDto.GetUserByToken(authHeader, Constant.APP_ID, Constant.APP_SECRET)); |
||||
|
if(ObjectUtil.isNull(userByToken)){ |
||||
|
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); |
||||
|
} |
||||
|
//通过手机号获取用户在服务内的userId
|
||||
|
if(StrUtil.isNotBlank(userByToken.getPhone())){ |
||||
|
user = userDao.getUserIdByPhone(userByToken.getPhone()); |
||||
|
log.info("{}获取user:{}", authHeader, user); |
||||
|
} |
||||
|
} |
||||
|
Signature signature = pjp.getSignature(); |
||||
|
MethodSignature methodSignature = (MethodSignature) signature; |
||||
|
Method targetMethod = methodSignature.getMethod(); |
||||
|
|
||||
|
MustLogin mustLoginAnnotation = targetMethod.getAnnotation(MustLogin.class); |
||||
|
fillSpecial(dto, mustLoginAnnotation); |
||||
|
|
||||
|
//必须登录,未登录直接返回未登录相关信息
|
||||
|
if (user == null) { |
||||
|
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN); |
||||
|
} |
||||
|
// JSONObject json = JSONObject.parseObject(JSON.toJSONString(response.getData()));
|
||||
|
// Long userId = json.getLong("id");
|
||||
|
// String userName = json.getString("userName");
|
||||
|
// String avatarUrl = json.getString("avatarUrl");
|
||||
|
// String phone = json.getString("phone");
|
||||
|
// if (userId == null || userId == 0) {
|
||||
|
// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
|
||||
|
// }
|
||||
|
|
||||
|
if (dto != null) { |
||||
|
dto.setUserId(user.getId()); |
||||
|
dto.setPhone(user.getPhone()); |
||||
|
} |
||||
|
|
||||
|
Object result = pjp.proceed(); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
private void fillSpecial(QueryDto dto, MustLogin mustLoginAnnotation) { |
||||
|
if (mustLoginAnnotation == null) { |
||||
|
return; |
||||
|
} |
||||
|
if (dto != null && mustLoginAnnotation.type() > -1) { |
||||
|
switch (mustLoginAnnotation.type()) { |
||||
|
case 0: |
||||
|
Object obj = dto.getParam(); |
||||
|
if (obj!= null && !obj.getClass().isArray()) { |
||||
|
Class<?> aClass = dto.getParam().getClass(); |
||||
|
Object o = Array.newInstance(aClass, 1); |
||||
|
Array.set(o, 0, dto.getParam()); |
||||
|
dto.setParam(o); |
||||
|
} |
||||
|
break; |
||||
|
case 1: |
||||
|
Object obj1 = dto.getParam(); |
||||
|
if (obj1!= null && !(obj1 instanceof List)) { |
||||
|
ArrayList arrayList = new ArrayList(); |
||||
|
arrayList.add(dto.getParam()); |
||||
|
dto.setParam(arrayList); |
||||
|
} |
||||
|
break; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,163 @@ |
|||||
|
package com.ccsens.ptos_zero.bean.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class DeliverDto { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询所有检查人") |
||||
|
public static class QueryChecker{ |
||||
|
@NotNull(message = "请选择项目") |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询任务下的交付物信息") |
||||
|
public static class GetTaskDeliver{ |
||||
|
@NotNull(message = "请选择任务") |
||||
|
@ApiModelProperty("任务id(分解id)") |
||||
|
private Long taskId; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询交付物的上传记录") |
||||
|
public static class QueryRecord{ |
||||
|
@NotNull(message = "请选择交付物信息") |
||||
|
@ApiModelProperty("交付物Id") |
||||
|
private Long deliverId; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询交付物的检查记录") |
||||
|
public static class QueryCheckLog{ |
||||
|
@NotNull(message = "请选择交付物") |
||||
|
@ApiModelProperty("提交记录id") |
||||
|
private Long deliverRecordId; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("添加交付物") |
||||
|
public static class SaveDeliver{ |
||||
|
@NotNull(message = "请选择项目") |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
@NotNull(message = "请选择任务") |
||||
|
@ApiModelProperty("任务id(分解id)") |
||||
|
private Long taskId; |
||||
|
@NotBlank(message = "交付物名称不能为空") |
||||
|
@ApiModelProperty("交付物名称") |
||||
|
private String deliverName; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("提交交付物信息") |
||||
|
public static class SubmitDeliver{ |
||||
|
@NotNull(message = "请选择项目") |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
@NotNull(message = "请选择交付物") |
||||
|
@ApiModelProperty("交付物id") |
||||
|
private Long deliverId; |
||||
|
@NotNull(message = "请传入文件信息") |
||||
|
@ApiModelProperty("文件信息") |
||||
|
private List<String> fileList; |
||||
|
@NotNull(message = "请选择检查人") |
||||
|
@ApiModelProperty("检查人id") |
||||
|
private List<Long> checkerList; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("检查交付物信息") |
||||
|
public static class CheckDeliver{ |
||||
|
@NotNull(message = "请选择项目") |
||||
|
@ApiModelProperty("项目id") |
||||
|
private Long projectId; |
||||
|
@NotNull(message = "请选择要审核交付物") |
||||
|
@ApiModelProperty("交付物提交记录id") |
||||
|
private Long deliverRecordId; |
||||
|
@ApiModelProperty("审核状态 0未检查,1已通过,2驳回 默认1已通过") |
||||
|
private byte type = 1; |
||||
|
@ApiModelProperty("备注信息") |
||||
|
private String remark; |
||||
|
@ApiModelProperty("分数") |
||||
|
private BigDecimal score; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
// @Data
|
||||
|
// @ApiModel("检查交付物")
|
||||
|
// public static class CheckDeliver{
|
||||
|
// @NotNull(message = "检查信息错误")
|
||||
|
// @ApiModelProperty("检查记录id")
|
||||
|
// private Long checkId;
|
||||
|
// @NotNull(message = "项目信息错误")
|
||||
|
// @ApiModelProperty("项目id")
|
||||
|
// private Long projectId;
|
||||
|
// @ApiModelProperty("检查状态(1-通过,2-驳回)")
|
||||
|
// private Byte status;
|
||||
|
// @ApiModelProperty("分数")
|
||||
|
// private String score;
|
||||
|
// @ApiModelProperty("评论")
|
||||
|
// private String remark;
|
||||
|
// }
|
||||
|
//
|
||||
|
// @Data
|
||||
|
// @ApiModel("提交交付物")
|
||||
|
// public static class SaveDeliver{
|
||||
|
// @NotNull(message = "请选择项目")
|
||||
|
// @ApiModelProperty("项目id")
|
||||
|
// private Long projectId;
|
||||
|
// @NotNull(message = "请选择任务")
|
||||
|
// @ApiModelProperty("分解任务id")
|
||||
|
// private Long taskSubId;
|
||||
|
// @ApiModelProperty("文本内容")
|
||||
|
// private String content;
|
||||
|
// @ApiModelProperty("文件信息")
|
||||
|
// private List<FileVo.FileInfo> fileInfoList;
|
||||
|
//// @ApiModelProperty("文件id")
|
||||
|
//// private Long fileId;
|
||||
|
//// @ApiModelProperty("文件路径")
|
||||
|
//// private String filePath;
|
||||
|
// @NotEmpty(message = "请选择检查人")
|
||||
|
// @ApiModelProperty("检查人列表")
|
||||
|
// private List<Long> checkerList;
|
||||
|
// }
|
||||
|
//
|
||||
|
// @Data
|
||||
|
// @ApiModel("查询任务的交付物历史")
|
||||
|
// public static class QueryDeliverOfTask{
|
||||
|
// @NotNull(message = "请选择项目信息")
|
||||
|
// @ApiModelProperty("项目id")
|
||||
|
// private Long projectId;
|
||||
|
// @NotNull(message = "请选择任务")
|
||||
|
// @ApiModelProperty("任务分解id")
|
||||
|
// private Long taskSubId;
|
||||
|
// }
|
||||
|
//
|
||||
|
// @Data
|
||||
|
// @ApiModel("查询项目的交付物历史")
|
||||
|
// public static class QueryDeliverOfProject {
|
||||
|
// @NotNull(message = "请选择项目信息")
|
||||
|
// @ApiModelProperty("项目id")
|
||||
|
// private Long projectId;
|
||||
|
// @ApiModelProperty("第几页")
|
||||
|
// @Min(value = 1)
|
||||
|
// private int pageNum = 1;
|
||||
|
// @ApiModelProperty("每页多少条")
|
||||
|
// @Min(value = 1)
|
||||
|
// @Max(value=100)
|
||||
|
// private int pageSize = 10;
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,150 @@ |
|||||
|
package com.ccsens.ptos_zero.bean.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class DeliverVo { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询任务下的交付物信息") |
||||
|
public static class DeliverOfTask{ |
||||
|
@ApiModelProperty("交付物id") |
||||
|
private Long deliverId; |
||||
|
@ApiModelProperty("交付物名字") |
||||
|
private String deliverName; |
||||
|
@ApiModelProperty("交付物提交记录id") |
||||
|
private Long deliverRecordId; |
||||
|
@ApiModelProperty("文件路径") |
||||
|
private List<String> details; |
||||
|
@ApiModelProperty("提交时间") |
||||
|
private Long submitTime; |
||||
|
@ApiModelProperty("提交人Id") |
||||
|
private Long submitMemberId; |
||||
|
@ApiModelProperty("提交人名称") |
||||
|
private String submitMemberName; |
||||
|
@ApiModelProperty("检查人列表") |
||||
|
private List<CheckerInfo> checkerList; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("检查人信息") |
||||
|
public static class CheckerInfo{ |
||||
|
@ApiModelProperty("检查记录id") |
||||
|
private Long checkId; |
||||
|
@ApiModelProperty("检查人id") |
||||
|
private Long checkerId; |
||||
|
@ApiModelProperty("检查人名字") |
||||
|
private String checkerName; |
||||
|
@ApiModelProperty("检查状态(0-未审核,1-通过,2-驳回)") |
||||
|
private Byte status; |
||||
|
@ApiModelProperty("分数") |
||||
|
private BigDecimal score; |
||||
|
@ApiModelProperty("备注") |
||||
|
private String remark; |
||||
|
@ApiModelProperty("是不是我(0-否,1-是)") |
||||
|
private Byte isMine; |
||||
|
@ApiModelProperty("检查时间") |
||||
|
private Long checkTime; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查询交付物提交记录") |
||||
|
public static class QueryDeliverRecord{ |
||||
|
@ApiModelProperty("交付物id") |
||||
|
private Long deliverId; |
||||
|
@ApiModelProperty("交付物名字") |
||||
|
private String deliverName; |
||||
|
@ApiModelProperty("交付物提交id") |
||||
|
private List<DeliverRecord> deliverRecordList; |
||||
|
} |
||||
|
@Data |
||||
|
@ApiModel("交付物提交记录") |
||||
|
public static class DeliverRecord{ |
||||
|
@ApiModelProperty("交付物提交记录id") |
||||
|
private Long deliverRecordId; |
||||
|
@ApiModelProperty("文件路径") |
||||
|
private List<String> details; |
||||
|
@ApiModelProperty("提交时间") |
||||
|
private Long submitTime; |
||||
|
@ApiModelProperty("检查人列表") |
||||
|
private List<CheckerInfo> checkerList; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
// @Data
|
||||
|
// @ApiModel("检查人信息")
|
||||
|
// public static class CheckerInfo{
|
||||
|
// @ApiModelProperty("检查记录id")
|
||||
|
// private String checkId;
|
||||
|
// @ApiModelProperty("检查人id")
|
||||
|
// private Long checkerId;
|
||||
|
// @ApiModelProperty("检查人名字")
|
||||
|
// private String checkerName;
|
||||
|
// @ApiModelProperty("检查状态(0-未审核,1-通过,2-驳回)")
|
||||
|
// private Byte status;
|
||||
|
// @ApiModelProperty("分数")
|
||||
|
// private String score;
|
||||
|
// @ApiModelProperty("备注")
|
||||
|
// private String remark;
|
||||
|
// @ApiModelProperty("是不是我(0-否,1-是)")
|
||||
|
// private Byte isMine;
|
||||
|
//
|
||||
|
// }
|
||||
|
//
|
||||
|
@Data |
||||
|
@ApiModel("所有检查人信息") |
||||
|
public static class Checker{ |
||||
|
@ApiModelProperty("检查人id") |
||||
|
private Long memberId; |
||||
|
@ApiModelProperty("检查人名字") |
||||
|
private String name; |
||||
|
@ApiModelProperty("用户id") |
||||
|
private Long userId; |
||||
|
@ApiModelProperty("是不是我(0-否,1-是)") |
||||
|
private Byte isMine = 0; |
||||
|
} |
||||
|
//
|
||||
|
//
|
||||
|
// @Data
|
||||
|
// @ApiModel("项目下的交付物记录")
|
||||
|
// public static class DeliverOfProject{
|
||||
|
// @ApiModelProperty("项目名称")
|
||||
|
// private String projectName;
|
||||
|
// @ApiModelProperty("任务列表")
|
||||
|
// private List<DeliverOfTask> deliverOfTaskList;
|
||||
|
// }
|
||||
|
//
|
||||
|
// @Data
|
||||
|
// @ApiModel("任务的交付物历史")
|
||||
|
// public static class DeliverOfTask{
|
||||
|
// @ApiModelProperty("交付物id")
|
||||
|
// private String id;
|
||||
|
// @ApiModelProperty("上传人名字")
|
||||
|
// private String name;
|
||||
|
// @ApiModelProperty("任务名称")
|
||||
|
// private String taskName;
|
||||
|
// @ApiModelProperty("上传时间")
|
||||
|
// private Long time;
|
||||
|
// @ApiModelProperty("文本内容")
|
||||
|
// private String content;
|
||||
|
// @ApiModelProperty("文件信息")
|
||||
|
// private List<FileVo.FileInfo> fileInfoList;
|
||||
|
//// @ApiModelProperty("文件id")
|
||||
|
//// private Long fileId;
|
||||
|
//// @ApiModelProperty("文件路径")
|
||||
|
//// private String filePath;
|
||||
|
// @ApiModelProperty("检查人列表")
|
||||
|
// private List<CheckerInfo> checkerList;
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
package com.ccsens.ptos_zero.persist.dao; |
||||
|
|
||||
|
import com.ccsens.ptos_zero.bean.po.PluDeliver; |
||||
|
import com.ccsens.ptos_zero.bean.vo.DeliverVo; |
||||
|
import com.ccsens.ptos_zero.persist.mapper.PluDeliverMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
public interface PluDeliverDao extends PluDeliverMapper { |
||||
|
|
||||
|
/** |
||||
|
* 查询任务下的交付物信息 |
||||
|
* @param taskId 任务id |
||||
|
* @param userId userId |
||||
|
* @return 返回最后一条提交记录 |
||||
|
*/ |
||||
|
DeliverVo.DeliverOfTask getDeliverByTask(@Param("taskId") Long taskId, @Param("userId") Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 查询交付物所有的提交记录 |
||||
|
* @param deliverId 交付物id |
||||
|
* @param userId userId |
||||
|
* @return 返回所有记录 |
||||
|
*/ |
||||
|
DeliverVo.QueryDeliverRecord queryDeliverRecord(@Param("deliverId") Long deliverId, @Param("userId") Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 查找交付物的所有检查记录 |
||||
|
* @param deliverRecordId 交付物提交记录 |
||||
|
* @param userId userId |
||||
|
* @return 返回所有检查记录 |
||||
|
*/ |
||||
|
List<DeliverVo.CheckerInfo> queryCheckLog(@Param("deliverRecordId") Long deliverRecordId, @Param("userId") Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 批量添加 |
||||
|
* @param deliverList |
||||
|
*/ |
||||
|
void insertSelectiveList(@Param("deliverList") List<PluDeliver> deliverList); |
||||
|
|
||||
|
/** |
||||
|
* 查询所有检查人 |
||||
|
* @param projectId 项目id |
||||
|
* @param userId userId |
||||
|
* @return 检查人列表 |
||||
|
*/ |
||||
|
List<DeliverVo.Checker> queryChecker(@Param("projectId") Long projectId, @Param("userId") Long userId); |
||||
|
|
||||
|
} |
@ -0,0 +1,217 @@ |
|||||
|
package com.ccsens.ptos_zero.service; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.lang.Snowflake; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.ccsens.ptos_zero.bean.dto.DeliverDto; |
||||
|
import com.ccsens.ptos_zero.bean.po.*; |
||||
|
import com.ccsens.ptos_zero.bean.vo.DeliverVo; |
||||
|
import com.ccsens.ptos_zero.persist.dao.*; |
||||
|
import com.ccsens.ptos_zero.persist.mapper.PluDeliverRecordCheckLogMapper; |
||||
|
import com.ccsens.ptos_zero.persist.mapper.PluDeliverRecordCheckMapper; |
||||
|
import com.ccsens.ptos_zero.persist.mapper.PluDeliverRecordFileMapper; |
||||
|
import com.ccsens.ptos_zero.persist.mapper.PluDeliverRecordMapper; |
||||
|
import com.ccsens.ptos_zero.util.ZeroCodeError; |
||||
|
import com.ccsens.util.exception.BaseException; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author AUSU |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) |
||||
|
public class DeliverService implements IDeliverService { |
||||
|
|
||||
|
@Resource |
||||
|
private ProMemberDao memberDao; |
||||
|
@Resource |
||||
|
private ProTaskSubDao taskSubDao; |
||||
|
// @Resource
|
||||
|
// private ProDeliverDao deliverDao;
|
||||
|
@Resource |
||||
|
private ProRoleTaskDao roleTaskDao; |
||||
|
@Resource |
||||
|
private ProRoleMemberDao roleMemberDao; |
||||
|
@Resource |
||||
|
private Snowflake snowflake; |
||||
|
@Resource |
||||
|
private PluDeliverDao pluDeliverDao; |
||||
|
@Resource |
||||
|
private PluDeliverRecordMapper deliverRecordMapper; |
||||
|
@Resource |
||||
|
private PluDeliverRecordFileMapper deliverRecordFileMapper; |
||||
|
@Resource |
||||
|
private PluDeliverRecordCheckMapper deliverRecordCheckMapper; |
||||
|
@Resource |
||||
|
private PluDeliverRecordCheckLogMapper checkLogMapper; |
||||
|
|
||||
|
@Override |
||||
|
public List<DeliverVo.Checker> queryChecker(DeliverDto.QueryChecker params, Long userId) { |
||||
|
return pluDeliverDao.queryChecker(params.getProjectId(),userId); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void saveDeliver(DeliverDto.SaveDeliver param, Long userId) { |
||||
|
verifyTaskAndUserId(param.getTaskId(), param.getProjectId(), userId); |
||||
|
//查找任务关联的交付物信息
|
||||
|
PluDeliverExample deliverExample = new PluDeliverExample(); |
||||
|
deliverExample.createCriteria().andTaskSubIdEqualTo(param.getTaskId()); |
||||
|
List<PluDeliver> pluDelivers = pluDeliverDao.selectByExample(deliverExample); |
||||
|
if(CollectionUtil.isNotEmpty(pluDelivers)){ |
||||
|
PluDeliver pluDeliver = pluDelivers.get(0); |
||||
|
pluDeliver.setName(param.getDeliverName()); |
||||
|
pluDeliverDao.updateByPrimaryKeySelective(pluDeliver); |
||||
|
}else { |
||||
|
//添加交付物信息
|
||||
|
PluDeliver pluDeliver = new PluDeliver(); |
||||
|
pluDeliver.setId(snowflake.nextId()); |
||||
|
pluDeliver.setTaskSubId(param.getTaskId()); |
||||
|
pluDeliver.setName(param.getDeliverName()); |
||||
|
pluDeliverDao.insertSelective(pluDeliver); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public DeliverVo.DeliverOfTask getDeliver(DeliverDto.GetTaskDeliver param, Long userId) { |
||||
|
//验证任务是否存在
|
||||
|
verifyTaskAndUserId(param.getTaskId(),null,null); |
||||
|
//查询任务的交付物信息
|
||||
|
return pluDeliverDao.getDeliverByTask(param.getTaskId(),userId); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void submitDeliver(DeliverDto.SubmitDeliver param, Long userId) { |
||||
|
//检查交付物是否存在
|
||||
|
PluDeliver pluDeliver = pluDeliverDao.selectByPrimaryKey(param.getDeliverId()); |
||||
|
if(ObjectUtil.isNull(pluDeliver)){ |
||||
|
throw new BaseException(ZeroCodeError.NOT_DELIVER); |
||||
|
} |
||||
|
//检查当前用户是否是任务负责人
|
||||
|
Long memberIdByUserId = verifyTaskAndUserId(pluDeliver.getTaskSubId(), param.getProjectId(), userId); |
||||
|
//添加交付物提交记录
|
||||
|
PluDeliverRecord deliverRecord = new PluDeliverRecord(); |
||||
|
deliverRecord.setId(snowflake.nextId()); |
||||
|
deliverRecord.setDeliverId(pluDeliver.getId()); |
||||
|
deliverRecord.setMemberId(memberIdByUserId); |
||||
|
deliverRecord.setSubmitTime(System.currentTimeMillis()); |
||||
|
deliverRecordMapper.insertSelective(deliverRecord); |
||||
|
//添加提交的文件信息
|
||||
|
if(CollectionUtil.isNotEmpty(param.getFileList())){ |
||||
|
param.getFileList().forEach(filePath ->{ |
||||
|
PluDeliverRecordFile deliverRecordFile = new PluDeliverRecordFile(); |
||||
|
deliverRecordFile.setId(snowflake.nextId()); |
||||
|
deliverRecordFile.setDeliverRecordId(deliverRecord.getId()); |
||||
|
deliverRecordFile.setFilePath(filePath); |
||||
|
deliverRecordFileMapper.insertSelective(deliverRecordFile); |
||||
|
}); |
||||
|
} |
||||
|
//添加检查人信息
|
||||
|
if(CollectionUtil.isNotEmpty(param.getCheckerList())){ |
||||
|
param.getCheckerList().forEach(checkerId ->{ |
||||
|
PluDeliverRecordCheck recordCheck = new PluDeliverRecordCheck(); |
||||
|
recordCheck.setId(snowflake.nextId()); |
||||
|
recordCheck.setCheckerId(checkerId); |
||||
|
recordCheck.setDeliverRecordId(deliverRecord.getId()); |
||||
|
deliverRecordCheckMapper.insertSelective(recordCheck); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void checkDeliver(DeliverDto.CheckDeliver param, Long userId) { |
||||
|
//检查交付物提交记录是否存在
|
||||
|
PluDeliverRecord deliverRecord = deliverRecordMapper.selectByPrimaryKey(param.getDeliverRecordId()); |
||||
|
if(ObjectUtil.isNull(deliverRecord)){ |
||||
|
throw new BaseException(ZeroCodeError.NOT_DELIVER); |
||||
|
} |
||||
|
//查找当前用户的成员id
|
||||
|
Long userOfMemberId = memberDao.findUserOfMemberId(param.getProjectId(), userId); |
||||
|
if (ObjectUtil.isNull(userOfMemberId)) { |
||||
|
throw new BaseException(ZeroCodeError.NO_POWER); |
||||
|
} |
||||
|
//检查当前用户是否是交付物的检查人
|
||||
|
PluDeliverRecordCheckExample recordCheckExample = new PluDeliverRecordCheckExample(); |
||||
|
recordCheckExample.createCriteria().andCheckerIdEqualTo(userOfMemberId).andDeliverRecordIdEqualTo(param.getDeliverRecordId()); |
||||
|
List<PluDeliverRecordCheck> pluDeliverRecordChecks = deliverRecordCheckMapper.selectByExample(recordCheckExample); |
||||
|
if(CollectionUtil.isEmpty(pluDeliverRecordChecks)){ |
||||
|
throw new BaseException(ZeroCodeError.NO_POWER); |
||||
|
} |
||||
|
PluDeliverRecordCheck deliverRecordCheck = pluDeliverRecordChecks.get(0); |
||||
|
//添加检查记录
|
||||
|
PluDeliverRecordCheckLog checkLog = new PluDeliverRecordCheckLog(); |
||||
|
checkLog.setId(snowflake.nextId()); |
||||
|
checkLog.setRecordCheckId(deliverRecordCheck.getId()); |
||||
|
checkLog.setCheckStatus(param.getType()); |
||||
|
checkLog.setRemark(param.getRemark()); |
||||
|
checkLog.setScore(param.getScore()); |
||||
|
checkLog.setTime(System.currentTimeMillis()); |
||||
|
checkLogMapper.insertSelective(checkLog); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public DeliverVo.QueryDeliverRecord queryRecord(DeliverDto.QueryRecord param, Long userId) { |
||||
|
//验证交付物是否存在
|
||||
|
PluDeliver pluDeliver = pluDeliverDao.selectByPrimaryKey(param.getDeliverId()); |
||||
|
if(ObjectUtil.isNull(pluDeliver)){ |
||||
|
throw new BaseException(ZeroCodeError.NOT_DELIVER); |
||||
|
} |
||||
|
//查询交付物信息
|
||||
|
return pluDeliverDao.queryDeliverRecord(param.getDeliverId(),userId); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<DeliverVo.CheckerInfo> queryCheckLog(DeliverDto.QueryCheckLog param, Long userId) { |
||||
|
//验证提交记录是否存在
|
||||
|
PluDeliverRecord deliverRecord = deliverRecordMapper.selectByPrimaryKey(param.getDeliverRecordId()); |
||||
|
if(ObjectUtil.isNull(deliverRecord)){ |
||||
|
throw new BaseException(ZeroCodeError.NOT_DELIVER); |
||||
|
} |
||||
|
//查找检查人的所有检查记录 倒叙排列
|
||||
|
return pluDeliverDao.queryCheckLog(param.getDeliverRecordId(),userId); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 验证任务是否存在, |
||||
|
* 如果userId和projectId不为空,则校验该用户是否是任务的负责人 |
||||
|
* @param taskId 任务分解id |
||||
|
* @param projectId 项目id |
||||
|
* @param userId userId |
||||
|
* @return 返回成员id |
||||
|
*/ |
||||
|
private Long verifyTaskAndUserId(Long taskId, Long projectId, Long userId) { |
||||
|
Long memberId = null; |
||||
|
//验证任务是否存在
|
||||
|
ProTaskSub taskSub = taskSubDao.selectByPrimaryKey(taskId); |
||||
|
if (ObjectUtil.isNull(taskSub)) { |
||||
|
throw new BaseException(ZeroCodeError.NOT_TASK); |
||||
|
} |
||||
|
if(ObjectUtil.isNotNull(userId) && ObjectUtil.isNotNull(projectId)){ |
||||
|
//查找当前用户的成员id
|
||||
|
Long userOfMemberId = memberDao.findUserOfMemberId(projectId, userId); |
||||
|
if (ObjectUtil.isNull(userOfMemberId)) { |
||||
|
throw new BaseException(ZeroCodeError.NO_POWER); |
||||
|
} |
||||
|
memberId = userOfMemberId; |
||||
|
//查找当前用户所属的角色
|
||||
|
List<Long> userOfRoles = roleMemberDao.findMemberOfRoleIds(userOfMemberId); |
||||
|
//查看是否是我负责的任务
|
||||
|
if (CollectionUtil.isNotEmpty(userOfRoles)) { |
||||
|
List<Long> isMyTask = roleTaskDao.isMyTask(taskSub.getTaskDetailId(), userOfRoles); |
||||
|
if (CollectionUtil.isEmpty(isMyTask)) { |
||||
|
throw new BaseException(ZeroCodeError.NO_POWER); |
||||
|
} |
||||
|
}else { |
||||
|
throw new BaseException(ZeroCodeError.NO_POWER); |
||||
|
} |
||||
|
} |
||||
|
return memberId; |
||||
|
} |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
package com.ccsens.ptos_zero.service; |
||||
|
|
||||
|
import com.ccsens.ptos_zero.bean.dto.DeliverDto; |
||||
|
import com.ccsens.ptos_zero.bean.vo.DeliverVo; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author AUSU |
||||
|
*/ |
||||
|
public interface IDeliverService { |
||||
|
|
||||
|
/** |
||||
|
* 查询所有检查人 |
||||
|
* @param params 项目id |
||||
|
* @param userId 用户id |
||||
|
* @return 检查人列表 |
||||
|
*/ |
||||
|
List<DeliverVo.Checker> queryChecker(DeliverDto.QueryChecker params, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 添加交付物 |
||||
|
* @param param 交付物名称和任务id |
||||
|
* @param userId userID |
||||
|
*/ |
||||
|
void saveDeliver(DeliverDto.SaveDeliver param, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 查看任务下的交付物信息 |
||||
|
* @param param 任务id |
||||
|
* @param userId userId |
||||
|
* @return 返回交付物信息 |
||||
|
*/ |
||||
|
DeliverVo.DeliverOfTask getDeliver(DeliverDto.GetTaskDeliver param, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 提交交付物内容 |
||||
|
* @param param 文件检查人等 |
||||
|
* @param userId userId |
||||
|
*/ |
||||
|
void submitDeliver(DeliverDto.SubmitDeliver param, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 检查交付物提交记录 |
||||
|
* @param param 检查信息 |
||||
|
* @param userId userId |
||||
|
*/ |
||||
|
void checkDeliver(DeliverDto.CheckDeliver param, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 查看交付物提交记录 |
||||
|
* @param param 交付物id |
||||
|
* @param userId userId |
||||
|
* @return 返回提交记录 |
||||
|
*/ |
||||
|
DeliverVo.QueryDeliverRecord queryRecord(DeliverDto.QueryRecord param, Long userId); |
||||
|
|
||||
|
/** |
||||
|
* 查看交付物的检查记录 |
||||
|
* @param param 交付物提交记录id |
||||
|
* @param userId userId |
||||
|
* @return 返回所有检查记录倒叙排列 |
||||
|
*/ |
||||
|
List<DeliverVo.CheckerInfo> queryCheckLog(DeliverDto.QueryCheckLog param, Long userId); |
||||
|
|
||||
|
} |
@ -1,318 +0,0 @@ |
|||||
//package com.ccsens.ptos_zero.util;
|
|
||||
//
|
|
||||
//import lombok.Getter;
|
|
||||
//
|
|
||||
//@Getter
|
|
||||
//public enum CodeEnum {
|
|
||||
// /**
|
|
||||
// * 异常
|
|
||||
// */
|
|
||||
// SUCCESS(200, "ok", true),
|
|
||||
// SYS_ERROR(500, "网络繁忙,请您稍后重试", false),
|
|
||||
// THIRD_ERROR(-1, "调用第三方刚接口异常", false),
|
|
||||
//
|
|
||||
// FILE_FORMAT_ERROR(1, "文件格式错误", true),
|
|
||||
// AUDITED(2, "已经审核通过,不重复提交。", true),
|
|
||||
// POSITION_NO_FOUND(3, "未找到对应职务,请重新选择职务。", true),
|
|
||||
// TITLE_NO_FOUND(4, "未找到对应职称,请重新选择职称。", true),
|
|
||||
// ADMIN_DEAL(5,"由于您的资格太高,请联系管理员进行审核。", true),
|
|
||||
// PARAM_NULL(6, "请检查您的参数是否填写完整。", true),
|
|
||||
// ROLE_NOT_FOUND(7, "未找到相关角色,请确认项目和角色信息。", true),
|
|
||||
// AUDIT_NOT_PASS (8, "对不起,您尚未审核通过,暂时没有操作权限。", true),
|
|
||||
// PARAM_ERROR(9,"请求参数错误,请确认操作是否正确。", true),
|
|
||||
// ID_CARD_ERROR(10,"身份证格式错误,请检查身份证填写是否正确。", true),
|
|
||||
// QUESTION_NOT_FOUND(11,"试题未找到。", true),
|
|
||||
//
|
|
||||
// WSB_NOT_PROJECT_HEADER(12,"没有项目信息的表头",true),
|
|
||||
// WSB_NOT_MEMBER_HEADER(13,"没有项目成员的表头",true),
|
|
||||
// WSB_NOT_TASK_HEADER(14,"没有项目任务分解的表头",true),
|
|
||||
// WBS_PROJECT_TIME_ERROR(15,"时间格式异常",true),
|
|
||||
// WBS_NOT_PROJECT_TIME(16,"项目时间不能为空",true),
|
|
||||
// WBS_NOT_PROJECT_NAME(17,"项目名称不能为空",true),
|
|
||||
// WBS_NOT_PROJECT(17,"找不到项目信息",true),
|
|
||||
// WBS_NOT_MEMBER_SHEET(18,"未找到项目成员表",true),
|
|
||||
// WBS_NOT_PHONE(19,"手机号为空",true),
|
|
||||
// WBS_PHONE_ERROR(19,"手机号格式错误",true),
|
|
||||
// WBS_STAKEHOLDER_PHONE(20,"奖惩干系人和手机号不匹配",true),
|
|
||||
// WBS_STAKEHOLDER_PHONE_NOT_FOUND(20,"请填写奖惩干系人手机号",true),
|
|
||||
// WBS_REPEAT_MEMBER_PHONE(21,"成员名或手机号与其他人重复",true),
|
|
||||
// WBS_NOT_FIRST_ROLE(22,"系统角色名称错误",true),
|
|
||||
// WBS_REPEAT_ROLE_NAME(23,"角色名称重复",true),
|
|
||||
// WSB_NOT_MEMBER(24,"未找到对应成员", true),
|
|
||||
// WBS_NOT_FIND_ROLE(25,"未找到对应的角色,请检查对谁不可见一列的名字与格式",true),
|
|
||||
// WBS_NOT_TASK_NAME(26,"任务名不能为空",true),
|
|
||||
// WBS_NOT_FIND_EXECUTOR_ROLE(27,"找不到负责人,请检查负责人的名称",true),
|
|
||||
// WBS_NOT_FIND_CHECKER_ROLE(28,"找不到检查人,请检查检查人的名称",true),
|
|
||||
// WBS_DELAY_ERROR(29,"任务切换模式填写错误",true),
|
|
||||
// WBS_SUB_TASK_ANALYSIS(30,"无法解析此子日程表",true),
|
|
||||
// WBS_NOT_SUB_TASK(31,"找不到对应的子表,请检查子表的名字是否正确",true),
|
|
||||
// WBS_NOT_PLUGIN_SHEET(32,"未找到插件表",true),
|
|
||||
// WBS_NOT_PLUGIN(33,"未找到对应的插件,请确认是否填写正确",true),
|
|
||||
// PROJECT_DATE_FORMAT_ERROR(34,"输入的日期格式错误,有效日期格式 例:2019-01-01或2019-01",true),
|
|
||||
// TASK_NOT_UPLOAD_DELIVER(35,"交付物未上传,无法完成任务",true),
|
|
||||
// NOT_PROJECT(36,"对不起,找不到该项目",true),
|
|
||||
// NOT_ROLE(37,"对不起,找不到该角色",true),
|
|
||||
// NOT_DELIVER(38,"对不起,找不到对应的交付物",true),
|
|
||||
// NOT_TASK(39,"找不到对应的任务",true),
|
|
||||
// NOT_DELIVER_FILE(40,"文件信息错误,请重试",true),
|
|
||||
// IS_NOT_EXECUTOR(41,"对不起,您不是该任务负责人",true),
|
|
||||
// NOT_CHECKER(42,"请选择检查人",true),
|
|
||||
// SUB_TASK_IS_NOT_FINISH(43,"分组内任务未全部完成,无法完成任务",true),
|
|
||||
// IS_NOT_CHECKER(44,"您不是该交付物的检查人",true),
|
|
||||
// NOT_POWER(45,"对不起,您的权限不足,无法进行此操作",true),
|
|
||||
// SMS_CODE_CORRECT(46,"请输入正确验证码",true),
|
|
||||
//
|
|
||||
// QUESTION_RULE_NOT_FOUND(47,"该评测规则未知,请联系开发人员。", true),
|
|
||||
// REPORT_DOCTOR_ERROR(48, "对不起,您没有修改报告单结果的权限。", true),
|
|
||||
// NOT_LOGIN(49, "对不起,您尚未登录或登录已失效,请重新登录。", true),
|
|
||||
// POSITION_NOT_3(50, "对不起,您尚未选择职务,请重新选择。", true),
|
|
||||
//
|
|
||||
// REPEAT_PROJECT_NAME(51,"项目名不能重复,请修改后重试",true),
|
|
||||
// TIME_ERROR_BEGIN(52,"时间异常,开始时间不能大于结束时间",true),
|
|
||||
// TIME_ERROR_PROJECT(53,"时间异常,任务的时间不能超出项目的时间",true),
|
|
||||
// HAS_GROUP_TIME_CHANGE(54,"分组任务不能直接修改时间,请修改其子任务时间",true),
|
|
||||
// DOCTOR_NOT_SUBMIT(55,"尚未进行资格认证",true),
|
|
||||
// REPORT_NOT_FOUND(56,"对不起,没有找到您查询的报告单,请确认报告单是否存在。",true),
|
|
||||
// PATIENT_NOT_CHOICE(57,"没有选择病人,不进行保存答案。", true),
|
|
||||
//
|
|
||||
// NOT_GAME_TYPE(58,"对不起,未找到对应的游戏",true),
|
|
||||
// SIGNIN_REPEAT(59,"请勿重复签到",true),
|
|
||||
// SCORE_REPEAT(60,"您已经评分,请勿重复提交",true),
|
|
||||
// NOT_MEMBER(61,"对不起,找不到对应的成员信息",true),
|
|
||||
// NOT_GAME_RECORD(62,"对不起,找不到对应的游戏场次",true),
|
|
||||
// NOT_JOIN_GAME(63,"您还未加入游戏,请参加游戏后再试",true),
|
|
||||
//
|
|
||||
// GAME_NO_END(64,"您的上一场游戏尚未结束,请勿重复开启",true),
|
|
||||
// GAME_NOT_TIMES(65,"游戏可玩次数不足,请充值后重试",true),
|
|
||||
//
|
|
||||
// GAME_PENDING(66, "游戏尚未开始,请等待主持人开始", true),
|
|
||||
// GAME_PREPARATION(67, "游戏已经开始倒计时了", true),
|
|
||||
// GAME_PROCESSING (68, "游戏已经在火热进行啦", true),
|
|
||||
// GAME_COMPLETED(69, "抱歉,您来晚了,游戏已结束", true),
|
|
||||
// NOT_REGISTER(70,"该手机号尚未注册账号",true),
|
|
||||
// PHONE_ERR(71,"请输入正确的手机号",true),
|
|
||||
// NOT_SELECT_WX(72,"未查到对应的微信信息",true),
|
|
||||
// ALREADY_EXIST_PHONE(73,"手机号已存在",true),
|
|
||||
// ALREADY_BINDING_PHONE(74,"您已绑定过手机号,请勿重复绑定",true),
|
|
||||
// MERGE_WX_PHONE(75,"该手机号已经注册过账号,是否将账号合并",true),
|
|
||||
// ALREADY_EXIST_ACCOUNT(76,"该账号已存在",true),
|
|
||||
// NOT_SIGN_FIELD(77,"签到的字段不可用",true),
|
|
||||
// ALREADY_SIGN(78,"您已经签到过了,请勿重复签到",true),
|
|
||||
// ALREADY_ATTENTION(79,"您已经关注了这个项目",true),
|
|
||||
// NOT_EMPLOYEE(80,"未找到成员信息",true),
|
|
||||
// NOT_SITE(81,"未找到该场所",true),
|
|
||||
// ALREADY_REAL_AUTH(82,"您已经完成认证",true),
|
|
||||
// LACK_CONFIG(83,"缺少配置",true),
|
|
||||
// ANIMAL_HEAT_ERROR(84,"体温异常,请选择正确的健康状态",true),
|
|
||||
// NOT_BUSINESS(85,"未找到商户信息",true),
|
|
||||
// SITE_EXCEED(86,"您所添加的场所数量已超出上限,请联系客服提高场所上限",true),
|
|
||||
// SITE_NAME_REPETITION(86,"场所名重复",true),
|
|
||||
// LOCATION_LONG(87,"对不起,您的距离太远了,请靠近目的地或打开定位后重试。",true),
|
|
||||
// NO_IMPORT_DATA(88,"没有有效的数据,请检查您的导入文件。",true),
|
|
||||
// FILL_ERROR(89,"您的信息填写有误,请检查您的信息。",true),
|
|
||||
// ACCOUNT_BIND(90,"您的帐号已经绑定了,请重新进入小程序。",true),
|
|
||||
// RECORDER_NOT(91, "对不起,您不是该信息的录入者,不能修改信息。", true),
|
|
||||
// REPORT_HAD_COMPLETED(92, "报告单已经完成,不能再修改答题记录。", true),
|
|
||||
// NOT_REAL_AUTH(93,"您尚未填写基本信息,请补全信息后再试。",true),
|
|
||||
// HEALTH_TYPE_ERROR(94,"您的健康状态异常,打卡失败。",true),
|
|
||||
// NOT_HEALTH_RECORD(95,"您今天还未上报健康信息,请上报后再试。",true),
|
|
||||
// SELECT_TIME_ERROR(96,"请输入正确的查询时间",true),
|
|
||||
//
|
|
||||
// TASK_PREPARATION(97,"任务已经开始了,请勿重复操作",true),
|
|
||||
// NOT_COMMENT(98,"该评论不存在",true),
|
|
||||
// NOT_MESSAGE_TYPE(99,"找不到消息类型,请检查名称是否正确",true),
|
|
||||
//
|
|
||||
// NOT_LABEL(100,"标签不存在,请检查后操作",true),
|
|
||||
// REPEAT_LABEL(101,"标签已存在,请勿重复添加",true),
|
|
||||
//
|
|
||||
// NICKNAME_REPEAT(102,"该名字已经存在,请换一个再试",true),
|
|
||||
// NEW_PASSWORD_REPEAT_OLD(103,"新密码不能和旧密码相同",true),
|
|
||||
// PASSWORD_ERROR(104,"用户名或密码错误",true),
|
|
||||
// NOT_ACCOUNT(105,"未找到该账号",true),
|
|
||||
//
|
|
||||
// FILE_NOT_FOUND(106,"未找到对应的文件,请检查后操作",true),
|
|
||||
// SIGNATURE_FAIL(107,"签名验证失败",true),
|
|
||||
//
|
|
||||
// NOT_UNIT(108,"时间单位不能为空",true),
|
|
||||
// NOT_USER(109,"用户不存在",true),
|
|
||||
// VERIFICATION_CODE_PAST(110,"验证码失效,请刷新重试",true),
|
|
||||
// VERIFICATION_CODE_PAST_IMG(110,"图形验证码失效,请刷新重试",true),
|
|
||||
// VERIFICATION_CODE_ERROR(111,"验证码错误",true),
|
|
||||
// VERIFICATION_CODE_ERROR_IMG(111,"图形验证码错误",true),
|
|
||||
// NOT_ROW(112,"该行不存在",true),
|
|
||||
// VOTED(113,"对不起,您已经支持过看好的队伍了",true),
|
|
||||
//
|
|
||||
// NOT_TOPIC(114,"找不到该题目",true),
|
|
||||
// NOT_GROUP(115,"找不到该组信息",true),
|
|
||||
// VOTE_COMPLETED(116,"投票已结束",true),
|
|
||||
// VOTE_NOT_START(117,"投票未开始",true),
|
|
||||
// NOT_CONFIG_OR_ERR(118,"缺少配置信息,或配置信息异常",true),
|
|
||||
// GROUP_MEMBER_LIMIT(119,"当前组内人员已满,请选择其他组",true),
|
|
||||
// GROUP_NOT_CHOICE(120,"请选择要加入的队伍",true),
|
|
||||
// JOINED_TEAM(121,"您已经加入队伍,无需重复加入",true),
|
|
||||
// TEAM_MEMBER_MORE(122,"加入队伍的人数已经达到上限,请选择其他队伍",true),
|
|
||||
// TEAM_COMPANY_NOT_SAME(123,"对不起,您和团队其他人不是同一个单位的", true),
|
|
||||
// TEAM_GROUP_NOT_SAME(124,"对不起,您和团队其他人不是同一个组别的", true),
|
|
||||
// BASE_INFO_LACK(125,"请先填写您的基本信息", true),
|
|
||||
// JOINED_MORE(126,"该类型比赛您参赛的数目已达上限", true),
|
|
||||
// JOINED_SAME(127,"您已经参加同类型的比赛了,不能再重复参加参赛", true),
|
|
||||
// PLAYER_INFO_ALREADY(127,"您已经有了报名信息,请不要重复提交", true),
|
|
||||
//
|
|
||||
// GAME_TIME_DUE(128,"您的游戏已到期,请重新购买", true),
|
|
||||
// TEAM_MEMBER_ERROR(129,"参赛人数不符合,请重新填写", true),
|
|
||||
// SIGN_UP_TIME_NOT_START(130,"报名未开始", true),
|
|
||||
// SIGN_UP_TIME_FINISHED(131,"报名已结束", true),
|
|
||||
//
|
|
||||
// PROJECT_IMITATION_NO(132,"该项目未开启变身系统", true),
|
|
||||
// PROJECT_IMITATION_CODE_ERROR(131,"秘钥错误", true),
|
|
||||
//
|
|
||||
// DINGDING_EXCEPTION(132,"钉钉接口调用异常。",true),
|
|
||||
// URL_ERROR(133, "请求路径转换异常", true),
|
|
||||
//
|
|
||||
// JOIN_PROJECT_NUM_FULL(134, "可参赛次数已满", true),
|
|
||||
// PHOTO_FILE_EXCEED_2M(135, "图片大小不能超过2M", true),
|
|
||||
// COACH_NUM_FULL(136,"教练人数已达上限",true),
|
|
||||
// LEADER_NUM_FULL(137,"领队人数已达上限",true),
|
|
||||
// AUTHORIZATION_AGREE(138,"请阅读并同意安全责任书",true),
|
|
||||
// NAME_EMPTY(139,"单位名称不能为空",true),
|
|
||||
// PHOTO_IS_EMPTY(140,"请上传证件照",true),
|
|
||||
// ID_CARD_ALREADY(141,"此身份证已注册",true),
|
|
||||
// NOT_COMPANY(142,"请先填写基础信息",true),
|
|
||||
// MT_NOT_GROUP(143,"请选择正确的组别信息",true),
|
|
||||
// CONTACTS_NAME_EMPTY(144,"联系人名称不能为空",true),
|
|
||||
// MEMBER_NUM_ERROR(145,"参赛人数不满足比赛人数要求",true),
|
|
||||
// GENDER_ERROR(146,"请选择正确的性别",true),
|
|
||||
// JOIN_AUTH_GROUP(147,"已参加了其他组别,无法再次报名",true),
|
|
||||
// ALREADY_JOIN_PROJECT(148,"该选手已经参加了比赛,不可修改身份证组别等信息",true),
|
|
||||
// ALREADY_JOIN_PROJECT_DEL(149,"取消报名后可删除",true),
|
|
||||
// ALREADY_UPLOAD_VIDEO(150,"您已经上传了视频,请勿重复提交",true),
|
|
||||
// ALREADY_UPLOAD_FORM(151,"请勿重复提交信息",true),
|
|
||||
// MESSAGEISNULL(152,"数据为空",true),
|
|
||||
// QUANTITYERROR(153,"住院号不正确",true),
|
|
||||
// NOT_HOSPITAL(154,"未找到医院信息",true),
|
|
||||
// ZHUYUANIDCHONGFU(155,"患者研究编号重复",true),
|
|
||||
// MEIYOUGAIYISHENG(156,"该医生信息查询不正确",true),
|
|
||||
// QINGTIJIAOSHITI(157,"未做出修改答案,修改后再提交",true),
|
|
||||
// DOC_REPEAT(158,"输入文档已存在",true),
|
|
||||
// DOC_NONE(161,"输入文档不存在",true),
|
|
||||
// NOTNAME(159,"未找到该列",true),
|
|
||||
// CHONGFU(160,"该成员在项目下有多个成员角色",true),
|
|
||||
// CHAOGUOSHI(161,"角色展示不能超过10个",true),
|
|
||||
// BAOHANJINLI(162,"不能删除包含经理得角色",true),
|
|
||||
// CHONGFUTIJIAO(163,"不要重复提交",true),
|
|
||||
// ZUISHAOCHUANLIANGE(164,"排序最少需要传入两个",true),
|
|
||||
// HOSPITAL_NOT_FOUND(165,"没有找到医院",true),
|
|
||||
// NOT_FOUND_PM(166,"系统角色缺少项目经理",true),
|
|
||||
// NOT_FOUND_MEMBER(167,"系统角色缺少项目成员",true),
|
|
||||
// NOT_SUPPORT_CYCLE(168,"重复规则文本格式暂不支持",true),
|
|
||||
// WBS_TASK_START_TIME_ERROR(168,"任务开始时间格式错误,请检查后操作",true),
|
|
||||
// WBS_TASK_END_TIME_ERROR(169,"任务结束时间格式错误,请检查后操作",true),
|
|
||||
// CANNOT_DELETE_PM(170,"无法删除项目经理",true),
|
|
||||
// LABEL_TOO_LONG(171,"标签长度过长,请不要超过六个字",true),
|
|
||||
// WBS_PROJECT_NAME_REPEAT(172,"项目名称不能重复",true),
|
|
||||
// DELIVER_REPEAT(173,"交付物已存在",true),
|
|
||||
// PARENT_PROJECT_NOT_MATCHING(174,"父任务与项目不匹配",true),
|
|
||||
// PM_NOT_MEMBER(175,"项目经理下必须有一个成员",true),
|
|
||||
// WisdomCar_NOT_Found(176,"没有找到绑定的平车信息",true),
|
|
||||
// WISDOM_CAR_RUNNED(177,"这段时间内平车正在运行,请结束平车运行或重新选择平车",true),
|
|
||||
// WISDOM_CAR_IS_EXIST(178,"平车不存在,请检查后操作",true),
|
|
||||
// TASK_IS_EXIST(179,"任务不存在,请检查后操作",true),
|
|
||||
// PATIENT_PROJECT_REPEAT(180,"已创建该患者的病例,请不要重复操作",true),
|
|
||||
// //TALL3
|
|
||||
// PROJECT_REGION_NO_SAME(181,"项目域不同无法进行操作",true),
|
|
||||
// NO_POWER(182,"权限不足",true),
|
|
||||
// DATA_DECRYPTION(183,"解密失败,数据可能遭受到破坏,操作取消。",true),
|
|
||||
// NOT_TEMPLATE(183,"找不到对应的模板信息",true),
|
|
||||
// DELETE_PROJECT_ERROR(184,"删除项目失败",true),
|
|
||||
// ;
|
|
||||
//
|
|
||||
//
|
|
||||
// public CodeEnum mtMsgPhoto(String msg){
|
|
||||
// this.msg = "请上传"+msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public static String mtJoinAuthGroup(String msg){
|
|
||||
// msg = msg+"已参加了其他组别,无法再次报名";
|
|
||||
// return msg;
|
|
||||
// }
|
|
||||
// public static String mtCertificate(String msg){
|
|
||||
// msg = msg+"未同时报名“30秒单摇跳”和“3分钟单摇跳”";
|
|
||||
// return msg;
|
|
||||
// }
|
|
||||
// public static String mtCertificateJoin(String msg){
|
|
||||
// msg = msg+"已报名“速度通级赛”无法取消当前项目";
|
|
||||
// return msg;
|
|
||||
// }
|
|
||||
// public CodeEnum mtProjectMsg(String msg){
|
|
||||
// this.msg = msg+"项目参赛次数已满";
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public CodeEnum mtProjectMsg1(String msg){
|
|
||||
// this.msg = msg+"报名人数已满";
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
//
|
|
||||
// public CodeEnum addMsg(String msg){
|
|
||||
// if(this.msg.contains("错误:")){
|
|
||||
// this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
|
|
||||
// }
|
|
||||
// this.msg = msg+"--错误:"+this.msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
//
|
|
||||
// public CodeEnum addMsg(String sheetName,Integer rowNum){
|
|
||||
// if(this.msg.contains("错误:")){
|
|
||||
// this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
|
|
||||
// }
|
|
||||
// this.msg = sheetName+"第"+rowNum+"行--错误:"+this.msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public CodeEnum addMsg(String sheetName,Integer rowNum,String value){
|
|
||||
// if(this.msg.contains("错误:")){
|
|
||||
// this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
|
|
||||
// }
|
|
||||
// this.msg = sheetName+"第"+rowNum+"行["+value+"]--错误:"+this.msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
//
|
|
||||
//
|
|
||||
// public CodeEnum addMsgAndMemberName(String msg,String memberName){
|
|
||||
// this.msg = msg+"行:成员["+memberName+"]"+this.msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public CodeEnum addMsgAndNoLookName(String msg,String noLookName){
|
|
||||
// this.msg = msg+"行:对谁不可见成员["+noLookName+"]"+this.msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
//
|
|
||||
// public CodeEnum addMsgLwb(String msg) {
|
|
||||
// this.msg = "未找到名为“"+msg+"”的列,请检查列名称是否正确";
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public static CodeEnum getByCode(int code) {
|
|
||||
// for (CodeEnum codeEnum: CodeEnum.values()) {
|
|
||||
// if (codeEnum.getCode() == code) {
|
|
||||
// return codeEnum;
|
|
||||
// }
|
|
||||
// }
|
|
||||
// return null;
|
|
||||
// }
|
|
||||
//
|
|
||||
// private CodeEnum(Integer code, String msg, boolean success) {
|
|
||||
// this.code = code;
|
|
||||
// this.msg = msg;
|
|
||||
// this.success = success;
|
|
||||
// }
|
|
||||
// private Integer code;
|
|
||||
// private String msg;
|
|
||||
// private boolean success;
|
|
||||
//
|
|
||||
// public void setMsg(String msg) {
|
|
||||
// this.msg = msg;
|
|
||||
// }
|
|
||||
//}
|
|
||||
//
|
|
@ -1,54 +0,0 @@ |
|||||
//package com.ccsens.ptos_zero.util;
|
|
||||
//
|
|
||||
//import lombok.Getter;
|
|
||||
//
|
|
||||
///**
|
|
||||
// * @author 逗
|
|
||||
// */
|
|
||||
//public class CodeError {
|
|
||||
//
|
|
||||
// public static final Code SUCCESS = new Code(200, "ok", true);
|
|
||||
// public static final Code SYS_ERROR = new Code(500, "网络繁忙,请您稍后重试", false);
|
|
||||
// public static final Code THIRD_ERROR = new Code(-1, "调用第三方刚接口异常", false);
|
|
||||
// public static final Code PARAM_ERROR = new Code(1, "参数异常", false);
|
|
||||
// public static final Code PARAM_LOCK = new Code(2, "必填参数为空", false);
|
|
||||
//
|
|
||||
// @Getter
|
|
||||
// public static class Code{
|
|
||||
// private Integer code;
|
|
||||
// private String msg;
|
|
||||
// private boolean success;
|
|
||||
//
|
|
||||
// public Code(Integer code, String msg, boolean success) {
|
|
||||
// this.code = code;
|
|
||||
// this.msg = msg;
|
|
||||
// this.success = success;
|
|
||||
// }
|
|
||||
//
|
|
||||
//
|
|
||||
// public Code addMsg(String msg){
|
|
||||
// if(this.msg.contains("错误:")){
|
|
||||
// this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
|
|
||||
// }
|
|
||||
// this.msg = msg+"--错误:"+this.msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public Code addMsg(String sheetName,Integer rowNum){
|
|
||||
// if(this.msg.contains("错误:")){
|
|
||||
// this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
|
|
||||
// }
|
|
||||
// this.msg = sheetName+"第"+rowNum+"行--错误:"+this.msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public Code addMsg(String sheetName,Integer rowNum,String value){
|
|
||||
// if(this.msg.contains("错误:")){
|
|
||||
// this.msg = this.msg.substring(this.msg.indexOf("错误:") + 3);
|
|
||||
// }
|
|
||||
// this.msg = sheetName+"第"+rowNum+"行["+value+"]--错误:"+this.msg;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// }
|
|
||||
//
|
|
||||
//}
|
|
@ -1,227 +0,0 @@ |
|||||
//package com.ccsens.ptos_zero.util;
|
|
||||
//
|
|
||||
//import com.ccsens.util.CodeEnum;
|
|
||||
//import com.ccsens.util.CodeError;
|
|
||||
//import io.swagger.annotations.ApiModel;
|
|
||||
//import io.swagger.annotations.ApiModelProperty;
|
|
||||
//import lombok.Data;
|
|
||||
//
|
|
||||
//@Data
|
|
||||
//@ApiModel
|
|
||||
//public class JsonResponse<T> {
|
|
||||
//
|
|
||||
// /**
|
|
||||
// * Common Error Constant
|
|
||||
// */
|
|
||||
// public static class RegularError {
|
|
||||
// public static final int ERRCODE_SUCCESS = 200;
|
|
||||
// public static final String ERRCODE_SUCCESS_PHASE = "ok";
|
|
||||
// public static final int ERRCODE_FAIL = -1;
|
|
||||
// public static final String ERRCODE_FAIL_PHASE = "error";
|
|
||||
// }
|
|
||||
//
|
|
||||
// /**
|
|
||||
// * Jwt Error Constant
|
|
||||
// */
|
|
||||
// public static class TokenError{
|
|
||||
// public static final int TOKEN_ERRCODE_OK = JwtUtil.JwtError.TOKEN_ERRCODE_OK;
|
|
||||
// public static final String TOKEN_ERRCODE_OK_PHASE = JwtUtil.JwtError.TOKEN_ERRCODE_OK_PHASE;
|
|
||||
// public static final int TOKEN_ERRCODE_NOTFOUND = JwtUtil.JwtError.TOKEN_ERRCODE_NOTFOUND;
|
|
||||
// public static final String TOKEN_ERRCODE_NOTFOUND_PHASE = JwtUtil.JwtError.TOKEN_ERRCODE_NOTFOUND_PHASE;
|
|
||||
// public static final int TOKEN_ERRCODE_SIGNATURE_INVALIDATE = JwtUtil.JwtError.TOKEN_ERRCODE_SIGNATURE_INVALIDATE;
|
|
||||
// public static final String TOKEN_ERRCODE_SIGNATURE_INVALIDATE_PHASE = JwtUtil.JwtError.TOKEN_ERRCODE_SIGNATURE_INVALIDATE_PHASE;
|
|
||||
// public static final int TOKEN_ERRCODE_EXPIRE = JwtUtil.JwtError.TOKEN_ERRCODE_EXPIRE;
|
|
||||
// public static final String TOKEN_ERRCODE_EXPIRE_PHASE = JwtUtil.JwtError.TOKEN_ERRCODE_EXPIRE_PHASE;
|
|
||||
// public static final int TOKEN_ERRCODE_STUB_NOT_FOUND = JwtUtil.JwtError.TOKEN_ERRCODE_STUB_NOT_FOUND;
|
|
||||
// public static final String TOKEN_ERRCODE_STUB_NOT_FOUND_PHASE = JwtUtil.JwtError.TOKEN_ERRCODE_STUB_NOT_FOUND_PHASE;
|
|
||||
// public static final int TOKEN_ERRCODE_USER_DISABLED = JwtUtil.JwtError.TOKEN_ERRCODE_USER_DISABLED;
|
|
||||
// public static final String TOKEN_ERRCODE_USER_DISABLED_PHASE = JwtUtil.JwtError.TOKEN_ERRCODE_USER_DISABLED_PHASE;
|
|
||||
// public static final int TOKEN_ERRCODE_FAILED = JwtUtil.JwtError.TOKEN_ERRCODE_FAILED;
|
|
||||
// public static final String TOKEN_ERRCODE_FAILED_PHASE = JwtUtil.JwtError.TOKEN_ERRCODE_FAILED_PHASE;
|
|
||||
// }
|
|
||||
//
|
|
||||
// @ApiModelProperty(value="状态码")
|
|
||||
// private Integer code;
|
|
||||
// @ApiModelProperty(value="数据")
|
|
||||
// private T data;
|
|
||||
// @ApiModelProperty(value="消息")
|
|
||||
// private String msg;
|
|
||||
// @ApiModelProperty(value="成功与否")
|
|
||||
// private boolean success;
|
|
||||
// @ApiModelProperty(value = "md5校验状态 0:未校验 1:校验一致 2:校验不一致")
|
|
||||
// private byte md5Status = 0;
|
|
||||
// @ApiModelProperty(value = "token信息")
|
|
||||
// private TokenObj tokenObj = new TokenObj();
|
|
||||
//
|
|
||||
// public void setTokenObj(String token, String refreshToken) {
|
|
||||
// this.tokenObj.setToken(token);
|
|
||||
// this.tokenObj.setRefreshToken(refreshToken);
|
|
||||
// }
|
|
||||
//
|
|
||||
// @Data
|
|
||||
// @ApiModel("token信息")
|
|
||||
// public static class TokenObj{
|
|
||||
// @ApiModelProperty(value = "token")
|
|
||||
// private String token;
|
|
||||
// @ApiModelProperty(value = "refreshToken")
|
|
||||
// private String refreshToken;
|
|
||||
//
|
|
||||
//// public TokenObj(String token, String refreshToken) {
|
|
||||
//// this.token = token;
|
|
||||
//// this.refreshToken = refreshToken;
|
|
||||
//// }
|
|
||||
//
|
|
||||
//// public TokenObj() {
|
|
||||
//// }
|
|
||||
// }
|
|
||||
//
|
|
||||
// public static class MD5Status{
|
|
||||
// public final static byte UNCHECK = 0;
|
|
||||
// public final static byte CHECK_SAME_YES = 1;
|
|
||||
// public final static byte CHECK_SAME_NO = 2;
|
|
||||
// }
|
|
||||
//
|
|
||||
// private JsonResponse() {
|
|
||||
// }
|
|
||||
//
|
|
||||
// public static JsonResponse newInstance(){
|
|
||||
// return new JsonResponse();
|
|
||||
// }
|
|
||||
//// public static JsonResponse newInstance(Class T){
|
|
||||
//// return new JsonResponse<T>();
|
|
||||
//// }
|
|
||||
//
|
|
||||
//
|
|
||||
//
|
|
||||
// public JsonResponse ok(){
|
|
||||
// this.code = CodeEnum.SUCCESS.getCode();
|
|
||||
// this.msg = CodeEnum.SUCCESS.getMsg();
|
|
||||
// this.success = CodeEnum.SUCCESS.isSuccess();
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse ok(T data, String token, String refreshToken){
|
|
||||
// ok();
|
|
||||
// this.data = data;
|
|
||||
// this.tokenObj.token = token;
|
|
||||
// this.tokenObj.refreshToken = refreshToken;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse ok(T data){
|
|
||||
// ok();
|
|
||||
// this.data = data;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse ok(CodeEnum codeEnum){
|
|
||||
// this.code = codeEnum.getCode();
|
|
||||
// this.msg = codeEnum.getMsg();
|
|
||||
// this.success = codeEnum.isSuccess();
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse ok(CodeEnum codeEnum, T data){
|
|
||||
// this.code = codeEnum.getCode();
|
|
||||
// this.msg = codeEnum.getMsg();
|
|
||||
// this.success = codeEnum.isSuccess();
|
|
||||
// this.data = data;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse ok(CodeError.Code code){
|
|
||||
// this.code = code.getCode();
|
|
||||
// this.msg = code.getMsg();
|
|
||||
// this.success = code.isSuccess();
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse fail(){
|
|
||||
// this.code = RegularError.ERRCODE_FAIL;
|
|
||||
// this.msg = RegularError.ERRCODE_FAIL_PHASE;
|
|
||||
// this.success = false;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse fail(String error){
|
|
||||
// fail();
|
|
||||
// this.msg = error;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse fail(int code){
|
|
||||
// fail();
|
|
||||
// this.code = code;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse fail(int code, String error){
|
|
||||
// fail();
|
|
||||
// this.code = code;
|
|
||||
// this.msg = error;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse fail(int code, String error, T obj){
|
|
||||
// fail();
|
|
||||
// this.code = code;
|
|
||||
// this.msg = error;
|
|
||||
// this.data = obj;
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// //Token null
|
|
||||
// public JsonResponse tokenNotFound(){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_NOTFOUND, TokenError.TOKEN_ERRCODE_NOTFOUND_PHASE);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// //Token expire
|
|
||||
// public JsonResponse tokenExpire(){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_EXPIRE, TokenError.TOKEN_ERRCODE_EXPIRE_PHASE);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public JsonResponse tokenExpire(String phase){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_EXPIRE,phase);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// public JsonResponse tokenSignatureFail(){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_SIGNATURE_INVALIDATE, TokenError.TOKEN_ERRCODE_SIGNATURE_INVALIDATE_PHASE);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public JsonResponse tokenSignatureFail(String phase){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_SIGNATURE_INVALIDATE,phase);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// //Token Stub Not Found
|
|
||||
// public JsonResponse tokenStubNotFound(){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_STUB_NOT_FOUND, TokenError.TOKEN_ERRCODE_STUB_NOT_FOUND_PHASE);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public JsonResponse tokenDisabled(String phase){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_STUB_NOT_FOUND,phase);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// //User Disabled
|
|
||||
// public JsonResponse userDisabled(){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_USER_DISABLED, TokenError.TOKEN_ERRCODE_USER_DISABLED_PHASE);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public JsonResponse userDisabled(String phase){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_USER_DISABLED,phase);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//
|
|
||||
// //Token Failed
|
|
||||
// public JsonResponse tokenFailed(){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_FAILED, TokenError.TOKEN_ERRCODE_FAILED_PHASE);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
// public JsonResponse tokenFailed(String phase){
|
|
||||
// fail(TokenError.TOKEN_ERRCODE_FAILED,phase);
|
|
||||
// return this;
|
|
||||
// }
|
|
||||
//}
|
|
@ -1,125 +0,0 @@ |
|||||
//package com.ccsens.ptos_zero.util;
|
|
||||
//
|
|
||||
//import cn.hutool.core.codec.Base64;
|
|
||||
//import cn.hutool.core.util.StrUtil;
|
|
||||
//import io.jsonwebtoken.*;
|
|
||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||
//
|
|
||||
//import javax.crypto.SecretKey;
|
|
||||
//import javax.crypto.spec.SecretKeySpec;
|
|
||||
//import java.security.SignatureException;
|
|
||||
//import java.util.Date;
|
|
||||
//import java.util.Map;
|
|
||||
//import java.util.Set;
|
|
||||
//
|
|
||||
///**
|
|
||||
// * @Author: __zHangSan
|
|
||||
// * @Description:
|
|
||||
// * @Date: Created in 17:40 2018/2/1
|
|
||||
// */
|
|
||||
//@Slf4j
|
|
||||
//public class JwtUtil {
|
|
||||
// /**
|
|
||||
// * Jwt Error Constant
|
|
||||
// */
|
|
||||
// public static class JwtError{
|
|
||||
// public static final int TOKEN_ERRCODE_OK = 200;
|
|
||||
// public static final String TOKEN_ERRCODE_OK_PHASE = "Token ok.";
|
|
||||
// public static final int TOKEN_ERRCODE_NOTFOUND = 401;
|
|
||||
// public static final String TOKEN_ERRCODE_NOTFOUND_PHASE = "Missing or invalid Authorization header.";
|
|
||||
// public static final int TOKEN_ERRCODE_SIGNATURE_INVALIDATE = 400;
|
|
||||
// public static final String TOKEN_ERRCODE_SIGNATURE_INVALIDATE_PHASE = "Token signature encoding error.";
|
|
||||
// public static final int TOKEN_ERRCODE_EXPIRE = 402;
|
|
||||
// public static final String TOKEN_ERRCODE_EXPIRE_PHASE = "Token Expire.";
|
|
||||
// public static final int TOKEN_ERRCODE_STUB_NOT_FOUND = 403;
|
|
||||
// public static final String TOKEN_ERRCODE_STUB_NOT_FOUND_PHASE = "Token stub not found.";
|
|
||||
// public static final int TOKEN_ERRCODE_USER_DISABLED = 405;
|
|
||||
// public static final String TOKEN_ERRCODE_USER_DISABLED_PHASE = "User disabled,Please concact the System Administrator.";
|
|
||||
// public static final int TOKEN_ERRCODE_FAILED = 406;
|
|
||||
// public static final String TOKEN_ERRCODE_FAILED_PHASE = "Token failed.";
|
|
||||
// }
|
|
||||
//
|
|
||||
// public static SecretKey generalKey(String secret) {
|
|
||||
// byte[] encodedKey = Base64.decode(secret);
|
|
||||
// SecretKey key = new SecretKeySpec(encodedKey, 0, encodedKey.length, "AES");
|
|
||||
// return key;
|
|
||||
// }
|
|
||||
//
|
|
||||
// /**
|
|
||||
// * 签发JWT
|
|
||||
// *
|
|
||||
// * @param subject
|
|
||||
// * @param ttlMillis
|
|
||||
// * @return
|
|
||||
// * @throws Exception
|
|
||||
// */
|
|
||||
// public static String createJWT(String subject, Map extraClaimMap, long ttlMillis,String secret) {
|
|
||||
// SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
|
|
||||
// long nowMillis = System.currentTimeMillis();
|
|
||||
// Date now = new Date(nowMillis);
|
|
||||
// SecretKey secretKey = generalKey(secret);
|
|
||||
// JwtBuilder builder = Jwts.builder()
|
|
||||
// .setIssuedAt(now)
|
|
||||
// .signWith(signatureAlgorithm, secretKey);
|
|
||||
// if(!StrUtil.isEmpty(subject)) {
|
|
||||
// builder.setSubject(subject);
|
|
||||
// }
|
|
||||
// if(extraClaimMap != null){
|
|
||||
// Set<Map.Entry<String,Object>> entrys = extraClaimMap.entrySet();
|
|
||||
// for(Map.Entry<String,Object> entry:entrys){
|
|
||||
// builder.claim(entry.getKey(),entry.getValue());
|
|
||||
// }
|
|
||||
// }
|
|
||||
// if (ttlMillis >= 0) {
|
|
||||
// long expMillis = nowMillis + ttlMillis;
|
|
||||
// Date expDate = new Date(expMillis);
|
|
||||
// builder.setExpiration(expDate);
|
|
||||
// }
|
|
||||
// return builder.compact();
|
|
||||
// }
|
|
||||
//
|
|
||||
// /**
|
|
||||
// * 签发JWT
|
|
||||
// *
|
|
||||
// * @param ttlMillis
|
|
||||
// * @return
|
|
||||
// * @throws Exception
|
|
||||
// */
|
|
||||
// public static String createJWT(Claims claims, long ttlMillis, String secret) {
|
|
||||
// SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
|
|
||||
// long nowMillis = System.currentTimeMillis();
|
|
||||
// Date now = new Date(nowMillis);
|
|
||||
// SecretKey secretKey = generalKey(secret);
|
|
||||
// JwtBuilder builder = Jwts.builder()
|
|
||||
// .setClaims(claims)
|
|
||||
// .setIssuedAt(now)
|
|
||||
// .signWith(signatureAlgorithm, secretKey);
|
|
||||
// if (ttlMillis >= 0) {
|
|
||||
// long expMillis = nowMillis + ttlMillis;
|
|
||||
// Date expDate = new Date(expMillis);
|
|
||||
// builder.setExpiration(expDate);
|
|
||||
// }
|
|
||||
// return builder.compact();
|
|
||||
// }
|
|
||||
//
|
|
||||
// /**
|
|
||||
// * 解析JWT字符串
|
|
||||
// *
|
|
||||
// * @param jwt
|
|
||||
// * @return
|
|
||||
// * @throws Exception
|
|
||||
// */
|
|
||||
// public static Claims parseJWT(String jwt, String secret)throws ExpiredJwtException,SignatureException,Exception{
|
|
||||
// SecretKey secretKey = generalKey(secret);
|
|
||||
// log.info("JWT解析token:{},,,{}",jwt,secretKey);
|
|
||||
// return Jwts.parser()
|
|
||||
// .setSigningKey(secretKey)
|
|
||||
// .parseClaimsJws(jwt)
|
|
||||
// .getBody();
|
|
||||
// }
|
|
||||
//
|
|
||||
// public static void main(String[] args) throws Exception {
|
|
||||
// String a = "eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MDczMDY4ODYsInN1YiI6IjEyMTc2NTEzNTQ5MTk2MzY5OTIiLCJhdXRoSWQiOiIxMTc3Mzk0MTQ5NzIxMjQ3NzQ0IiwiZXhwIjoxNjA3MzkzMjg2fQ.HSwJca28I2sddgyYf2dzNtn5M-mrPcVmbzvjn9dGZvE";
|
|
||||
// parseJWT(a,WebConstant.JWT_ACCESS_TOKEN_SECERT);
|
|
||||
// }
|
|
||||
//}
|
|
@ -1,24 +0,0 @@ |
|||||
//package com.ccsens.ptos_zero.util;
|
|
||||
//
|
|
||||
//import org.springframework.boot.env.YamlPropertySourceLoader;
|
|
||||
//import org.springframework.core.env.PropertySource;
|
|
||||
//import org.springframework.core.io.support.EncodedResource;
|
|
||||
//import org.springframework.core.io.support.PropertySourceFactory;
|
|
||||
//
|
|
||||
//import java.io.IOException;
|
|
||||
//
|
|
||||
///**
|
|
||||
// * @description:
|
|
||||
// * @author: wuHuiJuan
|
|
||||
// * @create: 2019/12/02 10:35
|
|
||||
// */
|
|
||||
//public class MyPropertySourceFactory implements PropertySourceFactory {
|
|
||||
// public MyPropertySourceFactory() {
|
|
||||
// super();
|
|
||||
// }
|
|
||||
//
|
|
||||
// @Override
|
|
||||
// public PropertySource<?> createPropertySource(String name, EncodedResource encodedResource) throws IOException {
|
|
||||
// return new YamlPropertySourceLoader().load(name, encodedResource.getResource()).get(0);
|
|
||||
// }
|
|
||||
//}
|
|
File diff suppressed because it is too large
@ -0,0 +1,203 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.ptos_zero.persist.dao.PluDeliverDao"> |
||||
|
|
||||
|
<resultMap id="deliverOfTask" type="com.ccsens.ptos_zero.bean.vo.DeliverVo$DeliverOfTask"> |
||||
|
<result column="deliverId" property="deliverId"/> |
||||
|
<result column="deliverName" property="deliverName"/> |
||||
|
<result column="deliverRecordId" property="deliverRecordId"/> |
||||
|
<result column="submitTime" property="submitTime"/> |
||||
|
<result column="submitMemberId" property="submitMemberId"/> |
||||
|
<result column="submitMemberName" property="submitMemberName"/> |
||||
|
<collection property="details" ofType="String"> |
||||
|
<result column="details"/> |
||||
|
</collection> |
||||
|
<collection property="checkerList" ofType="com.ccsens.ptos_zero.bean.vo.DeliverVo$CheckerInfo"> |
||||
|
<id column="checkId" property="checkId"/> |
||||
|
<result column="checkerId" property="checkerId"/> |
||||
|
<result column="checkerName" property="checkerName"/> |
||||
|
<result column="status" property="status"/> |
||||
|
<result column="score" property="score"/> |
||||
|
<result column="remark" property="remark"/> |
||||
|
<result column="isMine" property="isMine"/> |
||||
|
<result column="checkTime" property="checkTime"/> |
||||
|
</collection> |
||||
|
</resultMap> |
||||
|
<insert id="insertSelectiveList"> |
||||
|
INSERT INTO t_plu_deliver |
||||
|
( |
||||
|
id, |
||||
|
task_sub_id, |
||||
|
`name` |
||||
|
) |
||||
|
VALUES |
||||
|
<foreach collection="deliverList" item="item" separator=","> |
||||
|
(#{item.id},#{item.taskSubId},#{item.name}) |
||||
|
</foreach> |
||||
|
</insert> |
||||
|
|
||||
|
<select id="queryChecker" resultType="com.ccsens.ptos_zero.bean.vo.DeliverVo$Checker"> |
||||
|
SELECT |
||||
|
id AS memberId, |
||||
|
`name`, |
||||
|
user_id, |
||||
|
if(user_id = #{userId},1,0) as isMine |
||||
|
FROM |
||||
|
t_pro_member |
||||
|
WHERE |
||||
|
rec_status = 0 |
||||
|
AND project_id = #{projectId} |
||||
|
</select> |
||||
|
|
||||
|
<select id="getDeliverByTask" resultMap="deliverOfTask"> |
||||
|
SELECT |
||||
|
r.*, |
||||
|
f.id as recordFileId, |
||||
|
f.file_path as details, |
||||
|
clm.* |
||||
|
FROM |
||||
|
( |
||||
|
SELECT |
||||
|
d.id as deliverId, |
||||
|
d.`name` as deliverName, |
||||
|
dr.id as deliverRecordId, |
||||
|
dr.submit_time as submitTime, |
||||
|
dr.member_id as submitMemberId, |
||||
|
m.`name` as submitMemberName |
||||
|
FROM |
||||
|
t_plu_deliver d |
||||
|
LEFT JOIN t_plu_deliver_record dr on d.id = dr.deliver_id and dr.rec_status = 0 |
||||
|
LEFT JOIN t_pro_member m on dr.member_id = m.id and m.rec_status = 0 |
||||
|
WHERE |
||||
|
task_sub_id = #{taskId} |
||||
|
and d.rec_status = 0 |
||||
|
ORDER BY dr.submit_time DESC |
||||
|
limit 1 |
||||
|
)r |
||||
|
LEFT JOIN |
||||
|
t_plu_deliver_record_file f on r.deliverRecordId = f.deliver_record_id and f.rec_status = 0 |
||||
|
LEFT JOIN |
||||
|
( |
||||
|
SELECT |
||||
|
ch.*, |
||||
|
MAX(ch.checkTime) |
||||
|
FROM |
||||
|
( |
||||
|
SELECT |
||||
|
DISTINCT |
||||
|
c.id as checkId, |
||||
|
c.deliver_record_id as recordId, |
||||
|
c.checker_id as checkerId, |
||||
|
m.`name` as checkerName, |
||||
|
if(m.user_id = #{userId},1,0) as isMine, |
||||
|
cl.check_status as `status`, |
||||
|
cl.remark, |
||||
|
cl.score, |
||||
|
cl.time as checkTime |
||||
|
FROM |
||||
|
t_plu_deliver_record_check c |
||||
|
LEFT JOIN t_plu_deliver_record_check_log cl on c.id = cl.record_check_id and cl.rec_status = 0 |
||||
|
LEFT JOIN t_pro_member m on c.checker_id = m.id and m.rec_status = 0 |
||||
|
WHERE |
||||
|
c.rec_status = 0 |
||||
|
ORDER BY c.id, cl.time DESC |
||||
|
) ch |
||||
|
GROUP BY ch.checkId |
||||
|
)clm on r.deliverRecordId = clm.recordId |
||||
|
</select> |
||||
|
|
||||
|
<resultMap id="deliverRecord" type="com.ccsens.ptos_zero.bean.vo.DeliverVo$QueryDeliverRecord"> |
||||
|
<result column="deliverId" property="deliverId"/> |
||||
|
<result column="deliverName" property="deliverName"/> |
||||
|
<collection property="deliverRecordList" ofType="com.ccsens.ptos_zero.bean.vo.DeliverVo$DeliverRecord"> |
||||
|
<id column="deliverRecordId" property="deliverRecordId"/> |
||||
|
<result column="submitTime" property="submitTime"/> |
||||
|
<collection property="details" ofType="String"> |
||||
|
<result column="details"/> |
||||
|
</collection> |
||||
|
<collection property="checkerList" ofType="com.ccsens.ptos_zero.bean.vo.DeliverVo$CheckerInfo"> |
||||
|
<id column="checkId" property="checkId"/> |
||||
|
<result column="checkerId" property="checkerId"/> |
||||
|
<result column="checkerName" property="checkerName"/> |
||||
|
<result column="status" property="status"/> |
||||
|
<result column="score" property="score"/> |
||||
|
<result column="remark" property="remark"/> |
||||
|
<result column="isMine" property="isMine"/> |
||||
|
<result column="checkTime" property="checkTime"/> |
||||
|
</collection> |
||||
|
</collection> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="queryDeliverRecord" resultMap="deliverRecord"> |
||||
|
SELECT |
||||
|
r.*, |
||||
|
f.id as recordFileId, |
||||
|
f.file_path as details, |
||||
|
clm.* |
||||
|
FROM |
||||
|
( |
||||
|
SELECT |
||||
|
d.id as deliverId, |
||||
|
d.`name` as deliverName, |
||||
|
dr.id as deliverRecordId, |
||||
|
dr.submit_time as submitTime |
||||
|
FROM |
||||
|
t_plu_deliver d |
||||
|
LEFT JOIN t_plu_deliver_record dr on d.id = dr.deliver_id and dr.rec_status = 0 |
||||
|
WHERE |
||||
|
d.id = #{deliverId} |
||||
|
and d.rec_status = 0 |
||||
|
|
||||
|
)r |
||||
|
LEFT JOIN |
||||
|
t_plu_deliver_record_file f on r.deliverRecordId = f.deliver_record_id and f.rec_status = 0 |
||||
|
LEFT JOIN |
||||
|
( |
||||
|
SELECT |
||||
|
ch.*, |
||||
|
MAX(ch.checkTime) |
||||
|
FROM |
||||
|
( |
||||
|
SELECT |
||||
|
DISTINCT |
||||
|
c.id as checkId, |
||||
|
c.deliver_record_id as recordId, |
||||
|
c.checker_id as checkerId, |
||||
|
m.`name` as checkerName, |
||||
|
if(m.user_id = #{userId},1,0) as isMine, |
||||
|
cl.check_status as `status`, |
||||
|
cl.remark, |
||||
|
cl.score, |
||||
|
cl.time as checkTime |
||||
|
FROM |
||||
|
t_plu_deliver_record_check c |
||||
|
LEFT JOIN t_plu_deliver_record_check_log cl on c.id = cl.record_check_id and cl.rec_status = 0 |
||||
|
LEFT JOIN t_pro_member m on c.checker_id = m.id and m.rec_status = 0 |
||||
|
WHERE |
||||
|
c.rec_status = 0 |
||||
|
ORDER BY c.id, cl.time DESC |
||||
|
) ch |
||||
|
GROUP BY ch.checkId |
||||
|
)clm on r.deliverRecordId = clm.recordId |
||||
|
ORDER BY r.submitTime DESC, clm.checkTime DESC |
||||
|
</select> |
||||
|
<select id="queryCheckLog" resultType="com.ccsens.ptos_zero.bean.vo.DeliverVo$CheckerInfo"> |
||||
|
SELECT |
||||
|
c.id as checkId, |
||||
|
c.checker_id as checkerId, |
||||
|
m.`name` as checkerName, |
||||
|
if(m.user_id = #{userId},1,0) as isMine, |
||||
|
cl.check_status as `status`, |
||||
|
cl.remark, |
||||
|
cl.score, |
||||
|
cl.time as checkTime |
||||
|
FROM |
||||
|
t_plu_deliver_record_check_log cl |
||||
|
LEFT JOIN t_plu_deliver_record_check c on c.id = cl.record_check_id and c.rec_status = 0 |
||||
|
LEFT JOIN t_pro_member m on c.checker_id = m.id and m.rec_status = 0 |
||||
|
WHERE |
||||
|
c.deliver_record_id = #{deliverRecordId} |
||||
|
and c.rec_status = 0 |
||||
|
ORDER BY cl.time DESC |
||||
|
</select> |
||||
|
</mapper> |
Loading…
Reference in new issue