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
......@@ -81,6 +81,11 @@
<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>
</dependency>
......
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,
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));
return ResultUtil.data(list, "获取成功");
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("该审批已结束!");
}
......
......@@ -8,7 +8,6 @@ package cn.timer.api.controller.yggl;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
......@@ -23,9 +22,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import javax.transaction.Transactional;
import javax.websocket.server.PathParam;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.DeleteMapping;
......@@ -44,6 +41,7 @@ import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWra
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.util.StringUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
......@@ -79,13 +77,13 @@ import cn.timer.api.dao.yggl.YgMzDtoMapper;
import cn.timer.api.dao.yggl.YgProDtoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.dto.yggl.LoginerChargeDto;
import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgAreaDto;
import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgCityDto;
import cn.timer.api.dto.yggl.YgDrjqbDto;
import cn.timer.api.dto.yggl.YgDrsDto;
......@@ -96,7 +94,6 @@ import cn.timer.api.dto.yggl.YgbintuDto;
import cn.timer.api.dto.yggl.YgglCartogramDto;
import cn.timer.api.dto.yggl.YgjgDto;
import cn.timer.api.dto.yggl.YgmzDto;
import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.Md5;
import cn.timer.api.utils.Result;
......@@ -151,14 +148,16 @@ public class YgglController {
public Result<YgglMainEmp> loginmessage(@CurrentUser UserBean userBean) {
Integer empNum = userBean.getEmpNum();
Integer orgCode = userBean.getOrgCode();
YgglMainEmp ygglMainEmp=new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId,YgglMainEmp::getName,YgglMainEmp::getRzTime,YgglMainEmp::getEmpNum).
eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one();
YgglMainEmp ygglMainEmp = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId, YgglMainEmp::getName, YgglMainEmp::getRzTime, YgglMainEmp::getEmpNum)
.eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one();
Integer gw = ygglMainEmp.getBmgwId();
ZzglBmgwM bmid = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getUpId).eq(ZzglBmgwM::getId, gw).eq(ZzglBmgwM::getOrgCode, orgCode).one();
ZzglBmgwM bmid = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getUpId)
.eq(ZzglBmgwM::getId, gw).eq(ZzglBmgwM::getOrgCode, orgCode).one();
ygglMainEmp.setUnionid(bmid.toString());
return ResultUtil.data(ygglMainEmp, "部门id返回字段为unionid");
}
/**
* 获取登录人和上级主管的empNum和名称
*
......@@ -173,48 +172,53 @@ public class YgglController {
ArrayList<Integer> list = new ArrayList<Integer>();
Integer empNum = userBean.getEmpNum();
Integer gw = empNumConfirm(orgCode, empNum).getBmgwId();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).eq(ZzglBmgwM::getOrgCode, orgCode).list();
//获取该员工的上级部门id 的数组list
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, orgCode).list();
// 获取该员工的上级部门id 的数组list
ZzglBmgwM.getUpDepts(list, gw, zzglBmgwMs);
List<Integer> leaderList = new ArrayList<Integer>();
for (Integer zzglId : list) {
for (ZzglBmgwM zzglBmgwM : zzglBmgwMs) {
if (zzglId.equals(zzglBmgwM.getId()) && zzglBmgwM.getLeader()!=null) {
if (zzglId.equals(zzglBmgwM.getId()) && zzglBmgwM.getLeader() != null) {
leaderList.add(zzglBmgwM.getLeader());
}
}
}
List<YgglMainEmp> ygglMainEmps = empNumsConfirm(orgCode, leaderList);
List<LoginerChargeDto> loginerChargeDtos =new ArrayList<LoginerChargeDto>();
List<LoginerChargeDto> loginerChargeDtos = new ArrayList<LoginerChargeDto>();
for (YgglMainEmp m : ygglMainEmps) {
if (m.getHeadUrl() == null) {
m.setHeadUrl("");
}
loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(),m.getName(),m.getHeadUrl()));
loginerChargeDtos.add(new LoginerChargeDto(m.getEmpNum(), m.getName(), m.getHeadUrl()));
}
Collections.reverse(loginerChargeDtos);
return ResultUtil.data(loginerChargeDtos, "获取上级部门的部门id");
}
//根据传来的empNum获取该人员信息,没有则传全部
public List<YgglMainEmp> empNumsConfirm(Integer orgCode,List<Integer> empNumList) {
List<YgglMainEmp> all = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper).eq(YgglMainEmp::getOrgCode, orgCode).list();
// 根据传来的empNum获取该人员信息,没有则传全部
public List<YgglMainEmp> empNumsConfirm(Integer orgCode, List<Integer> empNumList) {
List<YgglMainEmp> all = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.eq(YgglMainEmp::getOrgCode, orgCode).list();
List<YgglMainEmp> ygglMainEmps = new ArrayList<YgglMainEmp>();
if (empNumList.size()!=0) {
if (empNumList.size() != 0) {
for (Integer empNum : empNumList) {
all.stream().filter(item -> empNum.equals(item.getEmpNum())).forEach(action ->{
all.stream().filter(item -> empNum.equals(item.getEmpNum())).forEach(action -> {
ygglMainEmps.add(action);
});
}
}else {
} else {
ygglMainEmps.addAll(all);
}
return ygglMainEmps;
}
//根据传来的empNum获取该人员信息
public YgglMainEmp empNumConfirm(Integer orgCode,Integer empNum) {
YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper).eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one();
// 根据传来的empNum获取该人员信息
public YgglMainEmp empNumConfirm(Integer orgCode, Integer empNum) {
YgglMainEmp one = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, empNum).one();
return one;
}
......@@ -229,11 +233,13 @@ public class YgglController {
@ApiOperation(value = "获取用户头像", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 70)
public Result<List<YgglMainEmp>> headphotos(@CurrentUser UserBean userBean, @RequestBody List<Integer> empNumList) {
if (empNumList.size()==0) {
if (empNumList.size() == 0) {
return ResultUtil.error("请输入empNum数组");
}
List<YgglMainEmp> yglList = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).in(YgglMainEmp::getEmpNum, empNumList).select(YgglMainEmp::getEmpNum,YgglMainEmp::getName,YgglMainEmp::getHeadUrl));
List<YgglMainEmp> yglList = YgglMainEmp.builder().build()
.selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
.in(YgglMainEmp::getEmpNum, empNumList)
.select(YgglMainEmp::getEmpNum, YgglMainEmp::getName, YgglMainEmp::getHeadUrl));
for (YgglMainEmp yg : yglList) {
if (StringUtil.isEmpty(yg.getHeadUrl())) {
yg.setHeadUrl("");
......@@ -241,6 +247,7 @@ public class YgglController {
}
return ResultUtil.data(yglList, "获取用户头像组成功");
}
/**
* 获取员工档案
*
......@@ -356,9 +363,13 @@ public class YgglController {
.build();
ygglMainEmp.insert();
if(addygdaDto.getBmgwId() != null) {
new LambdaUpdateChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.set(addygdaDto.getBmgwId() != null, YgglMainEmp::getBmgwId, addygdaDto.getBmgwId())
.eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getId, ygglMainEmp.getId()).update();
}
return ResultUtil.data(ygglMainEmp, "新添加员工档案成功!");
} else {
......@@ -430,9 +441,12 @@ public class YgglController {
ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.select("name", "emp_num", "bmgw_id", "rz_time", "job_type", "phone", "job_status")
.ne("job_status", YgEnumInterface.jobStatus.YILIZHI.getType()).eq("org_code", orgCode).eq(t != null && t > -1, "job_type", t)
.eq(j != null && j > -1, "job_status", j).in(!bList.isEmpty(), "bmgw_id", bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like("name", q).or().like("phone", q)).orderByDesc("rz_time");
.ne("job_status", YgEnumInterface.jobStatus.YILIZHI.getType())
.eq("org_code", orgCode)
.eq(t != null && t > -1, "job_type", t).eq(j != null && j > -1, "job_status", j)
.in(!bList.isEmpty(), "bmgw_id", bList)
.and(!StrUtil.hasBlank(q), wq -> wq.like("name", q).or().like("phone", q));
// List<YgglMainEmp> lo = YgglMainEmp.builder().build().selectList(queryWrapper);
IPage<YgglMainEmp> ygglMainEmpPage = YgglMainEmp.builder().build().selectPage(page, queryWrapper);
......@@ -1502,8 +1516,8 @@ public class YgglController {
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(3).build().update(updateWrapper);
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime()).lzyy(lzygQueryDto.getLzyy())
.lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
// 删除员工表
// ygglMainEmp.deleteById();
// 删除员工登陆表
......@@ -1528,9 +1542,10 @@ public class YgglController {
updateWrapper.eq("emp_num", lzygQueryDto.getEmpNum());
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).build().update(updateWrapper);
YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).sjlzTime(new Date()).build()
.update(updateWrapper1);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType())
.build().update(updateWrapper);
YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType())
.sjlzTime(new Date()).build().update(updateWrapper1);
// 查询该员工的关联表
QueryWrapper<QyzxEmpEntAsso> queryWrapper1 = new QueryWrapper<QyzxEmpEntAsso>();
queryWrapper1.eq("emp_num", lzygQueryDto.getEmpNum());
......@@ -1624,24 +1639,23 @@ public class YgglController {
@ApiOperationSupport(order = 60)
public Result<List<YgjgDto>> selectjgs(@CurrentUser UserBean userBean) {
List<YgjgDto> oldfather = new ArrayList<YgjgDto>();//老父亲
List<YgjgDto> oldfather = new ArrayList<YgjgDto>();// 老父亲
List<YgProDto> pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).list();//super继承人
List<YgProDto> pro = new LambdaQueryChainWrapper<YgProDto>(ygProDtoMapper).list();// super继承人
List<YgCityDto> city = new LambdaQueryChainWrapper<YgCityDto>(ygCityDtoMapper).list();
List<YgAreaDto> area = new LambdaQueryChainWrapper<YgAreaDto>(ygAreaDtoMapper).list();
for (YgProDto p : pro) {
Map<String, Object> map = BeanUtil.beanToMap(p);
//设置别名对应bean
// 设置别名对应bean
HashMap<String, String> mapping = CollUtil.newHashMap();
mapping.put("id", "jgid");
mapping.put("name", "jgname");
YgjgDto ygproDto = BeanUtil.mapToBean(map, YgjgDto.class,CopyOptions.create().setFieldMapping(mapping));
//添加cityList
//给一个upid
List<YgCityDto> outcity= uptocityList(city, ygproDto.getJgid());
//新建一个篮子
YgjgDto ygproDto = BeanUtil.mapToBean(map, YgjgDto.class, CopyOptions.create().setFieldMapping(mapping));
// 添加cityList
// 给一个upid
List<YgCityDto> outcity = uptocityList(city, ygproDto.getJgid());
// 新建一个篮子
List<YgjgDto> cityDtos = new ArrayList<YgjgDto>();
for (YgCityDto c : outcity) {
Map<String, Object> map2 = BeanUtil.beanToMap(c);
......@@ -1649,8 +1663,9 @@ public class YgglController {
mapping2.put("id", "jgid");
mapping2.put("name", "jgname");
mapping2.put("province", "upid");
YgjgDto ygcityDto = BeanUtil.mapToBean(map2, YgjgDto.class,CopyOptions.create().setFieldMapping(mapping2));
//把果实收起来
YgjgDto ygcityDto = BeanUtil.mapToBean(map2, YgjgDto.class,
CopyOptions.create().setFieldMapping(mapping2));
// 把果实收起来
cityDtos.add(ygcityDto);
List<YgAreaDto> outarea = uptoareaList(area, ygcityDto.getJgid());
......@@ -1661,7 +1676,8 @@ public class YgglController {
mapping3.put("id", "jgid");
mapping3.put("name", "jgname");
mapping3.put("city", "upid");
YgjgDto ygjgDto3 = BeanUtil.mapToBean(map3, YgjgDto.class,CopyOptions.create().setFieldMapping(mapping3));
YgjgDto ygjgDto3 = BeanUtil.mapToBean(map3, YgjgDto.class,
CopyOptions.create().setFieldMapping(mapping3));
areaDtos.add(ygjgDto3);
}
......@@ -1675,7 +1691,8 @@ public class YgglController {
return ResultUtil.data(oldfather, "老父亲出来了");
}
//根据上级id抽取出list
// 根据上级id抽取出list
public List<YgCityDto> uptocityList(List<YgCityDto> city, Integer jgid) {
List<YgCityDto> outcity = new ArrayList<YgCityDto>();
for (YgCityDto c : city) {
......@@ -1686,6 +1703,7 @@ public class YgglController {
city.removeAll(outcity);
return outcity;
}
public List<YgAreaDto> uptoareaList(List<YgAreaDto> area, Integer jgid) {
List<YgAreaDto> outarea = new ArrayList<YgAreaDto>();
for (YgAreaDto a : area) {
......@@ -1697,7 +1715,6 @@ public class YgglController {
return outarea;
}
/**
* 展示籍贯/展示所有籍贯(威力增强版)
*
......@@ -1734,7 +1751,6 @@ public class YgglController {
return ResultUtil.data(maps, "展示籍贯成功");
}
/**
* 查询员工列表
*
......@@ -1780,7 +1796,9 @@ public class YgglController {
List<YgglCartogramDto> ygglCartogramDto11 = ygglMainEmpMapper.queryWorkingAge(userBean);
map.put("positive", ygglCartogramDto1.getPositive());
if (ygglCartogramDto2 != null) {
map.put("avgAge", ygglCartogramDto2.getAvgAge());
}
map.put("induction", ygglCartogramDto3.getInduction());
map.put("probation", ygglCartogramDto4.getProbation());
map.put("regular", ygglCartogramDto4.getRegular());
......@@ -1857,7 +1875,8 @@ public class YgglController {
ageList.add(new YgKVDto(entry.getKey().toString(), entry.getValue().toString()));
}
// 在职
Integer zaizhi = jobStatus.get(YgEnumInterface.jobStatus.ZHENSHI.getType()).intValue() + jobStatus.get(YgEnumInterface.jobStatus.SHIYONG.getType()).intValue();
Integer zaizhi = jobStatus.get(YgEnumInterface.jobStatus.ZHENSHI.getType()).intValue()
+ jobStatus.get(YgEnumInterface.jobStatus.SHIYONG.getType()).intValue();
// 本月新入职
Integer xinruzhi = workage.get("本月新入职").intValue();
// 本月离职
......
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,19 +14,23 @@ 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 = "对象")
......
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")
......
......@@ -24,4 +24,6 @@ public class User implements Serializable{
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";
......@@ -114,6 +114,13 @@ public class ResultUtil<T> {
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);
this.result.setMessage(msg);
......@@ -179,4 +186,8 @@ public class ResultUtil<T> {
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
......@@ -126,6 +126,7 @@
(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