Commit 3c0ab6b6 by 东州 翁

Merge branch 'develop' of 120.24.24.239:8timerv2/8timerapiv200 into wdz

# Conflicts:
#	src/main/java/cn/timer/api/controller/yggl/YgglController.java
parents 9c343d1a 5093bf8e
......@@ -80,6 +80,11 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<scope>provided</scope>
......
package cn.timer.api.aspect;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.aspectj.lang.JoinPoint;
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.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import com.alibaba.fastjson.JSONObject;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.ClassUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.timer.api.aspect.lang.annotation.BindingResultCtrol;
import cn.timer.api.aspect.lang.bean.ValidationError;
import cn.timer.api.utils.ResultUtil;
/**
* 校验信息返回
*
* @author TZQ
*/
@Aspect
@Component
public class BindingResultAspect {
// 配置织入点
@Pointcut("@annotation(cn.timer.api.aspect.lang.annotation.BindingResultCtrol)")
public void bindingResultPointCut()
{
}
@Before("bindingResultPointCut()")
public void doBefore(JoinPoint point) throws Throwable
{
//预留
// handleDataScope(point);
}
@Around("bindingResultPointCut() && args(..,bindingResult)")
public Object doAround(ProceedingJoinPoint joinPoint,BindingResult bindingResult) throws Throwable {
Long startTime = System.currentTimeMillis();
Object retVal;
if(bindingResult.hasErrors()){
List<ObjectError> ls = bindingResult.getAllErrors();
List<ValidationError> listVe = new ArrayList<ValidationError>();
ValidationError ve;
for (ObjectError one : ls) {
String fieldString = one.getCodes().length >= 1 ? one.getCodes()[0] : "";
if (fieldString != null) {
fieldString = fieldString.substring(fieldString.lastIndexOf(".") + 1);
}
for (String str : one.getCodes()) {
System.err.println(str);
}
ve = ValidationError.builder().field(fieldString).msg(one.getDefaultMessage()).build();
listVe.add(ve);
}
retVal = ResultUtil.error(listVe);
}else {
retVal = joinPoint.proceed(joinPoint.getArgs());
}
Console.log("返回内容 {}: " ,JSONObject.toJSONString(retVal));
Long endtime = System.currentTimeMillis();
Console.log("执行耗时为{}:" ,endtime-startTime + "ms");
return retVal;
}
protected void handleDataScope(final JoinPoint joinPoint)
{
// 获得注解
BindingResultCtrol controllerDataScope = getAnnotationLog(joinPoint);
if (controllerDataScope == null)
return;
Console.log("title" + controllerDataScope.title());
Console.log("paramType" + controllerDataScope.paramType());
Object[] objs = joinPoint.getArgs();
List<Object> listObj = CollectionUtil.toList(objs);
BeanPropertyBindingResult optional = (BeanPropertyBindingResult)listObj.stream()
.filter(p -> "BeanPropertyBindingResult".equals(ClassUtil.getClassName(p, true)))
.findFirst()
.orElse(null);
if (optional != null && optional.hasErrors()) {
System.err.println("Optional: "+ optional);
}
}
/**
* 是否存在注解,如果存在就获取
*/
private BindingResultCtrol getAnnotationLog(JoinPoint joinPoint)
{
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method != null)
{
return method.getAnnotation(BindingResultCtrol.class);
}
return null;
}
}
package cn.timer.api.aspect.lang.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD,ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface BindingResultCtrol {
/**
* 模块
*/
public String title() default "8小时";
/**
* 参数类型
*/
public String paramType() default "对象";
}
package cn.timer.api.aspect.lang.bean;
import cn.timer.api.bean.spmk.SpmkApprovalG;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ValidationError {
private String field;
private String msg;
}
......@@ -37,7 +37,6 @@ import cn.timer.api.bean.dzht.DzhtAssoHtwj;
import cn.timer.api.bean.dzht.DzhtAssoQyrz;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
......@@ -607,7 +606,6 @@ public class DzhtController {
String ossUrl = htmb.getOssUrl();
String fileName = System.currentTimeMillis() + UUID.randomUUID().toString()
+ ossUrl.substring(ossUrl.lastIndexOf("."));
String filePath = null;
try {
filePath = FileHelper.downLoadFromUrl(ossUrl, fileName, savePath());
......
package cn.timer.api.controller.dzht.cn.tign.hz.constant;
import javax.annotation.PostConstruct;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
/**
* @version 2.0
......@@ -11,22 +8,22 @@ import org.springframework.beans.factory.annotation.Value;
*/
public class ConfigConstant {
public static String host;
public static String PROJECT_ID;
public static String PROJECT_SECRET;
@Value("${config-8timer.esign.host}")
private String host_s;
@Value("${config-8timer.esign.PROJECT_ID}")
private String PROJECT_ID_s;
@Value("${config-8timer.esign.PROJECT_SECRET}")
private String PROJECT_SECRET_s;
@PostConstruct
public void init() {
host = host_s;
PROJECT_ID = PROJECT_ID_s;
PROJECT_SECRET = PROJECT_SECRET_s;
}
public static String host = "https://smlopenapi.esign.cn";
public static String PROJECT_ID = "4438775940";
public static String PROJECT_SECRET = "7b100813cca2746081c57837855ac5af";
// @Value("${config-8timer.esign.host}")
// private String host_s;
// @Value("${config-8timer.esign.PROJECT_ID}")
// private String PROJECT_ID_s;
// @Value("${config-8timer.esign.PROJECT_SECRET}")
// private String PROJECT_SECRET_s;
//
// @PostConstruct
// public void init() {
// host = host_s;
// PROJECT_ID = PROJECT_ID_s;
// PROJECT_SECRET = PROJECT_SECRET_s;
// }
// 机构认证地址
public static final String getJgrz_URL(String accountId) {
......
package cn.timer.api.controller.kqgl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.timer.api.dto.kqgl.CompensateDto;
import cn.timer.api.dto.kqgl.LeaveTypeDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = "3.0考勤模块")
@RestController
@Transactional
@RequestMapping(value = "/kqmk", produces = { "application/json", "multipart/form-data" })
public class TimeCardController {
/**
* 查询列表-假期规则
*/
@GetMapping(value = "/list_leave_rules")
@ApiOperation(value = "1: 查询列表-假期规则", httpMethod = "GET", notes = " 查询列表-假期规则")
@ApiOperationSupport(order = 1)
public Result<Object> selectListLeaveRules() {
List<LeaveTypeDto> leas = new ArrayList<LeaveTypeDto>();
LeaveTypeDto lea = LeaveTypeDto.builder().build();
lea.setVacid(1);
lea.setVacname("事假");
leas.add(lea);
LeaveTypeDto lea2 = LeaveTypeDto.builder().build();
lea2.setVacid(2);
lea2.setVacname("调休");
leas.add(lea2);
LeaveTypeDto lea3 = LeaveTypeDto.builder().build();
lea3.setVacid(3);
lea3.setVacname("病假");
leas.add(lea3);
return ResultUtil.data(leas, "操作成功!");
}
/**
* 查询列表-加班补偿方式
*/
@GetMapping(value = "/list_compensate")
@ApiOperation(value = "2: 查询列表-加班补偿方式", httpMethod = "GET", notes = " 查询列表-加班补偿方式")
@ApiOperationSupport(order = 1)
public Result<Object> selectListCompensate() {
List<CompensateDto> coms = new ArrayList<CompensateDto>();
CompensateDto com = CompensateDto.builder().build();
com.setOvtiid(1);
com.setOvtiname("加班费");
coms.add(com);
CompensateDto coms2 = CompensateDto.builder().build();
coms2.setOvtiid(2);
coms2.setOvtiname("调休");
coms.add(coms2);
return ResultUtil.data(coms, "操作成功!");
}
}
......@@ -32,6 +32,7 @@ import com.github.pagehelper.PageHelper;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
......@@ -111,7 +112,7 @@ public class QyzxBusinessController {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxEntInfoM>().eq(QyzxEntInfoM::getId, userBean.getOrgCode()));
Date endTime = qyzxEntInfoM.getEndTime();
Long day = DateUtil.between(new Date(), endTime, DateUnit.DAY,false);
Long day = DateUtil.between(new Date(), endTime, DateUnit.DAY, false);
Integer level = qyzxEntInfoM.getLevel();
Map<String, Object> map1 = new HashMap<String, Object>();
......@@ -151,13 +152,22 @@ public class QyzxBusinessController {
@GetMapping(value = "/getPayList/System")
@ApiOperation(value = "获取系统续费商品列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxPayContent>> getPayListWithSystem(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3).select(
QyzxPayContent::getId, QyzxPayContent::getContent, QyzxPayContent::getNowPrice,
QyzxPayContent::getOriginalPrice, QyzxPayContent::getSpecification,
QyzxPayContent::getExpiration));
return ResultUtil.data(list, "获取成功");
public Result<Map<String, Object>> getPayListWithSystem(@CurrentUser UserBean userBean) {
List<QyzxPayContent> list1 = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3)
.eq(QyzxPayContent::getSpecification, 1).select(QyzxPayContent::getId,
QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice,
QyzxPayContent::getExpiration));
List<QyzxPayContent> list2 = QyzxPayContent.builder().build()
.selectList(new LambdaQueryWrapper<QyzxPayContent>().eq(QyzxPayContent::getPmid, 3)
.eq(QyzxPayContent::getSpecification, 2).select(QyzxPayContent::getId,
QyzxPayContent::getNowPrice, QyzxPayContent::getOriginalPrice,
QyzxPayContent::getExpiration));
Map<String, Object> map = new HashMap<String, Object>();
map.put("simple", list1);
map.put("professional", list2);
return ResultUtil.data(map, "获取成功");
}
@PostMapping(value = "/generateOrder")
......@@ -211,10 +221,35 @@ public class QyzxBusinessController {
return ResultUtil.pageData(list, page.getTotal(), "查询成功");
}
public static void main(String[] args) {
QyzxInvoiceData qyzxInvoiceData = new QyzxInvoiceData();
qyzxInvoiceData.setBankAccount("123");
qyzxInvoiceData.setBankName("234");
if (!ObjectUtil.isAllNotEmpty(qyzxInvoiceData, qyzxInvoiceData.getBankAccount(),
qyzxInvoiceData.getBankName())) {
System.out.println("请完善发票信息!");
} else {
System.err.println("可以,不错");
}
}
@PostMapping(value = "/invoicing")
@ApiOperation(value = "开发票", httpMethod = "POST", notes = "接口发布说明")
public Result<QyzxInvoiceData> generateOrder(@CurrentUser UserBean userBean,
@RequestBody QyzxInvoiceData qyzxInvoiceData) {
if (!ObjectUtil.isAllNotEmpty(
// qyzxInvoiceData,
qyzxInvoiceData.getInvoiceTitle(),
qyzxInvoiceData.getDutyParagraph(), qyzxInvoiceData.getCompanyAddress(),
qyzxInvoiceData.getCompanyPhone(), qyzxInvoiceData.getBankName(), qyzxInvoiceData.getBankAccount(),
qyzxInvoiceData.getInvoiceType(), qyzxInvoiceData.getInvoiceProject(),
qyzxInvoiceData.getInvoiceValue(), qyzxInvoiceData.getConsignee(), qyzxInvoiceData.getConsigneePhone(),
qyzxInvoiceData.getEmail(), qyzxInvoiceData.getShippingArea(), qyzxInvoiceData.getShippingAddress(),
qyzxInvoiceData.getZipCode())) {
return ResultUtil.error("请完善发票信息!");
}
String orderNo = qyzxInvoiceData.getOrderNo();
QyzxBuyRecord qyzxBuyRecord = QyzxBuyRecord.builder().build()
.selectOne(new LambdaQueryWrapper<QyzxBuyRecord>().eq(QyzxBuyRecord::getOrderNo, orderNo));
......
......@@ -4,8 +4,11 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -26,6 +29,7 @@ import cn.hutool.core.lang.Console;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.aspect.lang.annotation.BindingResultCtrol;
import cn.timer.api.bean.spmk.SpmkApprovalG;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
import cn.timer.api.bean.spmk.SpmkApprovalTemplateG;
......@@ -48,6 +52,7 @@ import cn.timer.api.dao.spmk.SpmkApproveSummaryMapper;
import cn.timer.api.dao.spmk.SpmkCustomApprovalMapper;
import cn.timer.api.dao.spmk.SpmkExecutorMapper;
import cn.timer.api.dao.spmk.SpmkInitiatorConfigMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.spmk.ApprovingDto;
import cn.timer.api.dto.spmk.FlowChildren;
import cn.timer.api.dto.spmk.FromData;
......@@ -375,13 +380,23 @@ public class SpmkServiceImpl {
@ApiOperation(value = "17.发起审批", httpMethod = "POST", notes = "发起审批")
@ApiOperationSupport(order = 17)
@Transactional(rollbackFor = Exception.class)
public Result<Object> saveCa(@CurrentUser UserBean userBean, @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto) throws Exception{
@BindingResultCtrol(title = "发起审批")
public Result<Object> saveCa(@CurrentUser UserBean userBean,@Valid @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto,BindingResult bindingResult) throws Exception{
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda()
.select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName)
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum()));
if (ygglMainEmp == null)
return ResultUtil.error("发起人异常!");
List<Router> listRouter = new ArrayList<Router>();
listRouter.add(spmkApproveSummaryDto.getRouter());
JSONObject jSONObject = spmkApproveSummaryDto.getRequestData()
.put("orgCode", FromData.builder().value(String.valueOf(userBean.getOrgCode())).build())
.put("initiator", FromData.builder().value(spmkApproveSummaryDto.getInitiator()).build())
.put("headUrl", FromData.builder().value(ygglMainEmp.getHeadUrl()).build())
.put("id", FromData.builder().value(StrUtil.toString(userBean.getEmpNum())).build());
RouterUtils.NextNode(listRouter, jSONObject, ISFIRST);
List<FlowChildren> listFlowChildren = new ArrayList<FlowChildren>();
......@@ -479,6 +494,20 @@ public class SpmkServiceImpl {
return ResultUtil.data(adD, "操作成功!");
}
//TODO 撤销审批
/**
* 撤销审批
*/
@PutMapping(value = "/revoke_approval/{id}")
@ApiOperation(value = "22.撤销审批", httpMethod = "PUT", notes = "撤销审批")
@Transactional(rollbackFor = Exception.class)
@ApiOperationSupport(order = 22)
public Result<Object> revokeApproval(@PathVariable Integer id) throws Exception {
return SpmkApproveSummary.builder().id(id).endTime(new Date()).sts(1).build().updateById() ?
ResultUtil.success("操作成功!") : ResultUtil.error("操作失败!");
}
//TODO 审批人审批
/**
* 审批人审批
......@@ -487,7 +516,8 @@ public class SpmkServiceImpl {
@ApiOperation(value = "20.审批人审批", httpMethod = "POST", notes = "审批人审批")
@Transactional(rollbackFor = Exception.class)
@ApiOperationSupport(order = 20)
public Result<Object> approving(@RequestBody ApprovingDto approvingDto) throws Exception {
// @BindingResultCtrol(title = "审批人审批")
public Result<Object> approving(@Valid @RequestBody ApprovingDto approvingDto, BindingResult bindingResult) throws Exception {
SpmkApproveDetail ad = SpmkApproveDetail.builder().build()
.selectOne(new QueryWrapper<SpmkApproveDetail>()
.lambda()
......@@ -498,7 +528,7 @@ public class SpmkServiceImpl {
.select(SpmkApproveSummary::getSts)
.eq(SpmkApproveSummary::getId, approvingDto.getAsId()));
if (aSummary.getSts() == 2 || aSummary.getSts() == 3) {
if (aSummary.getSts() == 1 || aSummary.getSts() == 2 || aSummary.getSts() == 3) {
return ResultUtil.error("该审批已结束!");
}
......
package cn.timer.api.dto.kqgl;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CompensateDto {
@ApiModelProperty(value = "加班补偿记录id", example = "1", required = true)
private Integer ovtiid;
@ApiModelProperty(value = "加班补偿名称", example = "加班费、调休")
private String ovtiname;
}
package cn.timer.api.dto.kqgl;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LeaveTypeDto {
@ApiModelProperty(value = "假期记录id", example = "1", required = true)
private Integer vacid;
@ApiModelProperty(value = "假期名称", example = "事假、调休...")
private String vacname;
}
package cn.timer.api.dto.spmk;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
......@@ -12,21 +14,25 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class ApprovingDto {
@NotNull(message = "asId为空")
@ApiModelProperty(value = "审批汇总id", example = "2", required = true)
private Integer asId;
@NotNull(message = "executeRecordId为空")
@ApiModelProperty(value = "审批执行记录id", example = "10", required = true)
private Integer executeRecordId;
@NotNull(message = "executorId为空")
@ApiModelProperty(value = "执行人记录id", example = "10", required = true)
private Integer executorId;
@ApiModelProperty(value = "意见", example = "MMMMMMMM")
@ApiModelProperty(value = "意见", example = "同意、拒绝")
private String opinion;
@ApiModelProperty(value = "状态 2同意 3拒绝", example = "2", required = true)
@NotNull(message = "sts为空")
@ApiModelProperty(value = "状态 2同意 3拒绝 4转派", example = "2", required = true)
private Integer sts;
@ApiModelProperty(value = "被转派人 ", example = "对象")
private User user;
......
package cn.timer.api.dto.spmk;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -17,7 +22,7 @@ public class MySummaryQueryDto extends Page{
private Integer empNum;
@ApiModelProperty(value = "关键字", example = "请假")
@ApiModelProperty(value = "关键字 标题/审批人名称/审批总汇id", example = "请假")
private String query;
@ApiModelProperty(value = "状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝", example = "0")
......@@ -29,6 +34,9 @@ public class MySummaryQueryDto extends Page{
@ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10")
private String endTime;
@NotNull(message = "type为空")
@DecimalMax(value = "2",message = "assoType 只能为 0我发起的 1抄送我的 2我审批的")
@DecimalMin(value = "0",message = "assoType 只能为 0我发起的 1抄送我的 2我审批的")
@ApiModelProperty(value = "0我发起的 1抄送我的 2我审批的", example = "0")
private Integer type;
......
......@@ -3,6 +3,8 @@ package cn.timer.api.dto.spmk;
import java.io.Serializable;
import java.util.List;
import javax.validation.constraints.Size;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONSupport;
import lombok.AllArgsConstructor;
......
package cn.timer.api.dto.spmk;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import javax.validation.Valid;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 审批汇总
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SpmkApproveSummaryDto{
/*
* 审批汇总
*/
@NotBlank(message = "title为空")
@ApiModelProperty(value = "标题 ", example = "标题", required = true)
private String title;
@NotBlank(message = "approveName为空")
@ApiModelProperty(value = "审批名称 ", example = "审批名称", required = true)
private String approveName;
@NotBlank(message = "initiator为空")
@ApiModelProperty(value = "发起人名称 ", example = "发起人名称", required = true)
private String initiator;
@ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡 ", example = "5")
@NotNull(message = "assoType为空")
@DecimalMax(value = "9",message = "assoType 只能为 0无 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡")
@DecimalMin(value = "0",message = "assoType 只能为 0无 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡")
@ApiModelProperty(value = "关联类型 0无 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡 ", example = "5")
private Integer assoType;
@NotNull(message = "requestData为空")
@ApiModelProperty(value = "申请数据 ", example = "申请数据", required = true)
private JSONObject requestData;
@NotNull(message = "froms为空")
@ApiModelProperty(value = "审批表单 ", example = "数组", required = true)
private List<JSONObject> froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程", required = true)
@NotNull(message = "router为空")
@ApiModelProperty(value = "审批流程", example = "审批流程", required = true)
private Router router;
}
......@@ -18,7 +18,7 @@ public class SummaryQueryDto extends Page{
private Integer orgCode;
@ApiModelProperty(value = "关键字", example = "请假")
@ApiModelProperty(value = "关键字 标题/审批人名称/审批总汇id", example = "请假")
private String query;
@ApiModelProperty(value = "部门id", example = "10")
......
......@@ -23,5 +23,7 @@ public class User implements Serializable{
private String id;
private String execute;
private String headUrl;
}
......@@ -27,7 +27,7 @@ public class ResultUtil<T> {
private static final String MESSAGE_UNLOGIN = "会话超时,请重新登录";
// private static final String MESSAGE_ERROR = "操作错误";
// private static final String MESSAGE_KICKOUT = "当前账户已在其他地方登录,请重新登录";
// private static final String MESSAGE_PARAMERROR = "参数错误";
private static final String MESSAGE_PARAMERROR = "参数错误";
// private static final String MESSAGE_UNAUTHORIZED = "授权错误";
// private static final String MESSAGE_UNAUTHENTICATED = "认证错误";
// private static final String MESSAGE_EXCEPTION = "服务器异常";
......@@ -37,7 +37,7 @@ public class ResultUtil<T> {
// private static final String STATUS_CODE_ERROR = "202";
private static final String STATUS_CODE_UNLOGIN = "301";
// private static final String STATUS_CODE_KICKOUT = "302";
// private static final String STATUS_CODE_UNPARAM = "400";
private static final String STATUS_CODE_UNPARAM = "400";
// private static final String STATUS_CODE_UNAUTHORIZED = "401";
// private static final String STATUS_CODE_UNAUTHENTICATED = "405";
private static final String STATUS_CODE_EXCEPTION = "500";
......@@ -113,6 +113,13 @@ public class ResultUtil<T> {
this.result.setMessage(msg);
return this.result;
}
public Result<T> setErrorMsg(T t) {
this.result.setData(t);
this.result.setCode(STATUS_CODE_UNPARAM);
this.result.setMessage(MESSAGE_PARAMERROR);
return this.result;
}
public Result<T> setErrorMsg(String msg) {
this.result.setResult(false);
......@@ -178,5 +185,9 @@ public class ResultUtil<T> {
public static <T> Result<T> error(String code, String msg) {
return new ResultUtil<T>().setErrorMsg(code, msg);
}
public static <T> Result<T> error(T t) {
return new ResultUtil<T>().setErrorMsg(t);
}
}
......@@ -35,7 +35,7 @@ import cn.timer.api.utils.ResultUtil;
@Component
public class OSSUtil {
@Value("${config-8timer.Aliyun.PROJECT_NAME}")
@Value("${config-8timer.Aliyun.endpoint}")
private String endpoint;
@Value("${config-8timer.Aliyun.ACCESSKEY_ID}")
......@@ -70,6 +70,7 @@ public class OSSUtil {
// 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录
// https://ram.console.aliyun.com 创建RAM账号。
// 创建OSSClient实例。
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
// 创建存储空间。
ossClient.createBucket(bucketName);
......@@ -92,6 +93,9 @@ public class OSSUtil {
// <yourObjectName>上传文件到OSS时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。
// String objectName = "8time-v2/test/123.jpg";
// 创建OSSClient实例。
System.err.println(endpoint);
System.err.println(accessKeyId);
System.err.println(accessKeySecret);
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
// 创建PutObjectRequest对象。
......
......@@ -73,6 +73,7 @@ public class RouterUtils {
User userFirst = User.builder()
.name(obj.get("initiator",FromData.class).getValue())
.id(obj.get("id",FromData.class).getValue())
.headUrl(obj.get("headUrl",FromData.class).getValue())
.execute("0")
.build();
users.add(userFirst);
......@@ -342,6 +343,7 @@ public class RouterUtils {
SpmkExecutor.builder()
.approveExecuteRecordId(aer.getId())
.empNum(Integer.parseInt(user.getId()))
.operatorHeaderUrl(user.getHeadUrl())
.executorName(user.getName())
.sts(2)
.build()
......@@ -366,6 +368,7 @@ public class RouterUtils {
SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer2.getId())
.empNum(Integer.parseInt(user2.getId()))
.operatorHeaderUrl(user2.getHeadUrl())
.executorName(user2.getName())
.build();
switch (user2.getExecute()) {
......@@ -404,6 +407,7 @@ public class RouterUtils {
.approveExecuteRecordId(aer3.getId())
.empNum(Integer.parseInt(user2.getId()))
.executorName(user2.getName())
.operatorHeaderUrl(user2.getHeadUrl())
.sts(2)
.build();
executor.insert();
......@@ -443,6 +447,7 @@ public class RouterUtils {
.opinion(opinion)
.empNum(Integer.parseInt(listUser.get(i_user).getId()))
.executorName(listUser.get(i_user).getName())
.operatorHeaderUrl(listUser.get(i_user).getHeadUrl())
.sts(sts)
.build()
.updateById();
......@@ -476,6 +481,7 @@ public class RouterUtils {
.approveExecuteRecordId(executeRecordId)
.empNum(Integer.parseInt(listUser.get(i_user).getId()))
.executorName(listUser.get(i_user).getName())
.operatorHeaderUrl(listUser.get(i_user).getHeadUrl())
.sts(1)
.build()
.insert();
......@@ -522,6 +528,7 @@ public class RouterUtils {
.approveExecuteRecordId(aer.getId())
.empNum(Integer.parseInt(user.getId()))
.executorName(user.getName())
.operatorHeaderUrl(user.getHeadUrl())
.sts(2)
.build()
.insert();
......@@ -545,6 +552,7 @@ public class RouterUtils {
.approveExecuteRecordId(aer2.getId())
.empNum(Integer.parseInt(listUser.get(i_user2).getId()))
.executorName(listUser.get(i_user2).getName())
.operatorHeaderUrl(listUser.get(i_user2).getHeadUrl())
.sts(1)
.build();
executor.insert();
......@@ -576,6 +584,7 @@ public class RouterUtils {
.approveExecuteRecordId(aer3.getId())
.empNum(Integer.parseInt(user2.getId()))
.executorName(user2.getName())
.operatorHeaderUrl(user2.getHeadUrl())
.sts(2)
.build();
executor.insert();
......
......@@ -98,7 +98,7 @@
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and qlb.create_time <![CDATA[ <= ]]> #{param.endTime}
and a.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
<if test="param.empNums != null and param.empNums.size() > 0">
and a.emp_num IN
......@@ -125,7 +125,8 @@
(SELECT approve_summary_id FROM spmk_approve_execute_record WHERE id IN
(SELECT approve_execute_record_id FROM spmk_executor WHERE emp_num = #{param.empNum})
and type = #{param.type}
)
)
and a.sts <![CDATA[ <> ]]> 1
</if>
<if test="param.type != null and param.type == 0">
......@@ -146,7 +147,7 @@
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and qlb.create_time <![CDATA[ <= ]]> #{param.endTime}
and a.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
ORDER BY a.id DESC
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment