Commit d8bb2296 by 邓实川

Merge branch 'develop' of http://120.24.24.239:8082/8timerv2/8timerapiv200.git into dsc

parents f149fbd4 e7097c08
......@@ -38,7 +38,7 @@ public class QyzxAttaFpgl extends Model<QyzxAttaFpgl> {
@ApiModelProperty(value="编号 编号",example="101")
private Integer id;
@ApiModelProperty(value="组织机构代码 组织机构代码",example="101")
@ApiModelProperty(value="组织机构代码 ",example="101")
private Integer orgCode;
@ApiModelProperty(value="发票抬头 ",example="发票抬头")
......@@ -56,7 +56,7 @@ public class QyzxAttaFpgl extends Model<QyzxAttaFpgl> {
@ApiModelProperty(value="开户银行 ",example="开户银行")
private String depositBank;
@ApiModelProperty(value="开户账号 开户账号",example="101")
@ApiModelProperty(value="开户账号",example="101")
private String depositBankAccount;
@ApiModelProperty(value="是否默认 0:是;1:否",example="101")
......
......@@ -38,7 +38,7 @@ public class QyzxAttaQyfj extends Model<QyzxAttaQyfj> {
@ApiModelProperty(value="编号 编号",example="101")
private Integer id;
@ApiModelProperty(value="组织机构代码 qyzx_main_qyxx",example="101")
@ApiModelProperty(value="组织机构代码",example="101")
private Integer orgCode;
@ApiModelProperty(value="附件名称 ",example="附件名称")
......
......@@ -72,8 +72,6 @@ public class QyzxInvoiceUsual extends Model<QyzxInvoiceUsual>{
@ApiModelProperty(value="发票类型",example="0-普通 1-专用")
private Integer invoiceType;
@ApiModelProperty(value="收货人",example="翁🐻")
private String consignee;
......
......@@ -37,21 +37,21 @@ public class QyzxSuggestionFeeback extends Model<QyzxSuggestionFeeback> {
@ApiModelProperty(value="员工编号",example="9688")
private Integer empNum;
@ApiModelProperty(value="",example="不好用")
@ApiModelProperty(value="意见文本",example="不好用")
private String opinionText;
@ApiModelProperty(value="",example="1")
@ApiModelProperty(value="bug类型",example="1")
private Integer bugType;
@ApiModelProperty(value="",example="2020-4-20 08:00:00")
@ApiModelProperty(value="创建时间",example="2020-4-20 08:00:00")
private Date createTime;
@ApiModelProperty(value="",example="117")
@ApiModelProperty(value="组织机构代码",example="117")
private Integer orgCode;
@ApiModelProperty(value="",example="那别用了")
@ApiModelProperty(value="回复",example="那别用了")
private String reply;
@ApiModelProperty(value="",example="2020-4-21 08:00:00")
@ApiModelProperty(value="回复时间",example="2020-4-21 08:00:00")
private Date replyTime;
}
\ No newline at end of file
......@@ -72,6 +72,9 @@ public class SpmkApproveSummary extends Model<SpmkApproveSummary> {
@ApiModelProperty(value = "历史审批人 ", example = "历史审批人")
private String historyApprover;
@ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "5")
private Integer assoType;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "最近处理时间 ", example = "最近处理时间")
......
......@@ -31,7 +31,6 @@ import cn.hutool.core.util.NumberUtil;
import cn.timer.api.bean.qyzx.QyzxAttaFwjsb;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.bean.qyzx.QyzxEntAuth;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.qyzx.QyzxFeebackAccessory;
import cn.timer.api.bean.qyzx.QyzxInvoiceUsual;
......@@ -43,7 +42,7 @@ import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.dao.qyzx.QyzxAttaFpzlMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
import cn.timer.api.dao.qyzx.QyzxEntAuthMapper;
......@@ -58,6 +57,7 @@ import cn.timer.api.dto.login.QysDto;
import cn.timer.api.dto.qyzx.AdminListDto;
import cn.timer.api.dto.qyzx.AttaFpglQueryDto;
import cn.timer.api.dto.qyzx.EntauthDto;
import cn.timer.api.dto.qyzx.FeebackDto;
import cn.timer.api.dto.qyzx.LogBuyDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
......@@ -90,9 +90,6 @@ public class QyzxController {
private QyzxLogBuyMapper qyzxLogBuyMapper;
@Autowired
private QyzxAttaFpzlMapper qyzxAttaFpzlMapper;
@Autowired
private QyzxEntAuthMapper qyzxEntAuthMapper;
@Autowired
......@@ -309,8 +306,11 @@ public class QyzxController {
} else {
// 获取权限
ArrayList<Integer> list = new ArrayList<Integer>();
List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
.eq(ZzglBmgwM::getOrgCode, ctrl.getId()).list();
// List<ZzglBmgwM> zzglBmgwMs = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper)
// .eq(ZzglBmgwM::getOrgCode, ctrl.getId()).list();
List<ZzglBmgwM> zzglBmgwMs = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda().eq(ZzglBmgwM::getOrgCode, ctrl.getId()));
// 传入的部门岗位是登录者的岗位id.获取的list中只有一个元素,不必要
ZzglBmgwM.getupDepts(list, ctrl.getBmgwId(), zzglBmgwMs);
if (list != null && list.size() > 0) {
......@@ -334,220 +334,57 @@ public class QyzxController {
}
}
/**
* 获取开票资料
*/
/*
*
* @Override public Result<QyzxEntInfoM> selectfpzl() { Integer orgCode =
* List<QyzxAttaFpzl> qyzxAttaFpzl =
* QyzxAttaFpzl.builder().build().selectList(new
* QueryWrapper<QyzxAttaFpzl>().eq("org_code", orgCode)); return new
* ResultUtil.data("获取发票资料成功", qyzxAttaFpzl); }
*
*
*//**
* 添加/修改开票资料
*
* @param
* @return
*/
/*
* @PostMapping(value = "/fpzl")
*
* @ApiOperation(value = "添加/修改发票资料", httpMethod = "POST", notes = "接口发布说明")
* public Result<QyzxAttaFpzl> addfpzl(@CurrentUser UserBean
* userBean, @RequestBody QyzxAttaFpzl qyzxAttaFpzl) {
* qyzxAttaFpzl.setOrgCode(userBean.getOrgCode());
* qyzxAttaFpzl.insertOrUpdate(); return ResultUtil.data(qyzxAttaFpzl,
* "添加/修改发票资料成功"); }
*
*//**
* 设置默认发票
*
* @param
* @return
*/
/*
* @GetMapping(value = "/defaultfp/{id}")
*
* @ApiOperation(value = "设置默认发票", httpMethod = "GET", notes = "接口发布说明") public
* Result<Void> setdef(@CurrentUser UserBean userBean, @PathVariable("id")
* Integer id) { // 将所有地址设为非默认 UpdateWrapper<QyzxAttaFpzl> updateWrapper = new
* UpdateWrapper<QyzxAttaFpzl>(); QyzxAttaFpzl q =
* QyzxAttaFpzl.builder().orgCode(userBean.getOrgCode()).isDefault(2).build();
* qyzxAttaFpzlMapper.update(q, updateWrapper);
*
* // 根据id将发票设为默认 updateWrapper.eq("id", id); QyzxAttaFpzl w =
* QyzxAttaFpzl.builder().orgCode(userBean.getOrgCode()).id(id).isDefault(1).
* build(); qyzxAttaFpzlMapper.update(w, updateWrapper);
*
* // 返回成功 return ResultUtil.success("设置成功"); }
*
*//**
* 删除开票资料
*
* @param
* @return
*/
/*
* @DeleteMapping(value = "/fpzl/{id}")
*
* @ApiOperation(value = "删除发票资料", httpMethod = "DELETE", notes = "接口发布说明")
* public Result<Integer> deletefpzl(@PathVariable Integer id) {
* QyzxAttaFpzl.builder().build().deleteById(id); return ResultUtil.data(id,
* "删除发票资料成功"); }
*
* // 获取发票管理
*
* @Override public Result<QyzxEntInfoM> selectfpgl() { Integer orgCode =
* qyzxAttaFpgl = QyzxAttaFpgl.builder().build().selectList(new
* QueryWrapper<QyzxAttaFpgl>().eq("org_code", orgCode)); return new
* ResultUtil.data("获取发票管理成功", qyzxAttaFpgl); }
*
*
*//**
* 添加/修改发票管理
*
* @param
* @return
*/
/*
* @PostMapping(value = "/fpgl")
*
* @ApiOperation(value = "添加/修改发票管理", httpMethod = "POST", notes = "接口发布说明")
* public Result<QyzxAttaFpgl> addfpgl(@CurrentUser UserBean
* userBean, @RequestBody QyzxAttaFpgl qyzxAttaFpgl) {
* qyzxAttaFpgl.setOrgCode(userBean.getOrgCode());
* qyzxAttaFpgl.insertOrUpdate(); return ResultUtil.data(qyzxAttaFpgl,
* "添加/修改发票管理成功"); }
*
*//**
* 删除开票资料
*
* @param
* @return
*/
/*
* @DeleteMapping(value = "/fpgl/{id}")
*
* @ApiOperation(value = "删除发票管理", httpMethod = "DELETE", notes = "接口发布说明")
* public Result<Integer> deletefpgl(@PathVariable Integer id) {
* QyzxAttaFpgl.builder().build().deleteById(id); return ResultUtil.data(id,
* "删除发票管理成功"); }
*
*//**
* 开票资料查询
*
* @param
* @return
*/
/*
* @PostMapping(value = "/fpzlquery")
*
* @ApiOperation(value = "发票资料查询", httpMethod = "POST", notes = "接口发布说明") public
* Result<Object> queryfpzl(@CurrentUser UserBean userBean,
*
* @RequestBody QyzxAttaFpzlQueryDto qyzxAttaFpzlQueryDto) { String
* titleOrAddress = qyzxAttaFpzlQueryDto.getNameOrAddress();
*
* Page<QyzxAttaFpzl> page = new Page<QyzxAttaFpzl>(
* qyzxAttaFpzlQueryDto.getCurrentPage() == null ? 1 :
* qyzxAttaFpzlQueryDto.getCurrentPage(), qyzxAttaFpzlQueryDto.getTotalPage() ==
* null ? 10 : qyzxAttaFpzlQueryDto.getTotalPage());
*
* QueryWrapper<QyzxAttaFpzl> queryWrapper = new QueryWrapper<>();
* queryWrapper.eq("org_code",
* userBean.getOrgCode()).and(!StrUtil.hasBlank(titleOrAddress), wq ->
* wq.likeRight("address", titleOrAddress).or().likeRight("title",
* titleOrAddress)); IPage<QyzxAttaFpzl> qyzxAttaFpzlPage =
* QyzxAttaFpzl.builder().build().selectPage(page, queryWrapper);
* List<QyzxAttaFpzl> qyzxAttaFpzls = qyzxAttaFpzlPage.getRecords();
* qyzxAttaFpzlPage.getCurrent(); qyzxAttaFpzlPage.getPages();
* qyzxAttaFpzlPage.getTotal(); qyzxAttaFpzlPage.getSize(); return
* ResultUtil.data(qyzxAttaFpzlPage, qyzxAttaFpzls, "发票资料查询成功"); }
*
*//**
* 发票管理查询
*
* @param
* @return
*//*
* @PostMapping(value = "/fpglquery")
*
* @ApiOperation(value = "发票管理查询", httpMethod = "POST", notes = "接口发布说明") public
* Result<Object> queryfpgl(@CurrentUser UserBean userBean, @RequestBody
* AttaFpglQueryDto attaFpglQueryDto) { String query =
* attaFpglQueryDto.getQuery(); String startTime =
* attaFpglQueryDto.getStartTime(); String endTime =
* attaFpglQueryDto.getEndTime(); Page<QyzxAttaFpgl> page = new
* Page<QyzxAttaFpgl>( attaFpglQueryDto.getCurrentPage() == null ? 1 :
* attaFpglQueryDto.getCurrentPage(), attaFpglQueryDto.getTotalPage() == null ?
* 10 : attaFpglQueryDto.getTotalPage()); Integer orgCode =
* userBean.getOrgCode(); QueryWrapper<QyzxAttaFpgl> queryWrapper = new
* QueryWrapper<>(); queryWrapper.eq("org_code",
* orgCode).gt(!StrUtil.hasBlank(startTime), "create_time", startTime)
* .lt(!StrUtil.hasBlank(endTime), "create_time", endTime)
* .and(!StrUtil.hasBlank(query), wq -> wq.likeRight("title",
* query).or().likeRight("project", query)); List<QyzxAttaFpgl> qyzxAttaFpgls =
* QyzxAttaFpgl.builder().build().selectList(queryWrapper);
*
* queryWrapper.eq("org_code", orgCode) .between(!StrUtil.hasBlank(startTime) &&
* !StrUtil.hasBlank(endTime), "create_time", !StrUtil.hasBlank(startTime) ?
* startTime : "1000-01-01 00:00:00", !StrUtil.hasBlank(endTime) ? endTime :
* "9999-01-01 00:00:00") .and(!StrUtil.hasBlank(query), wq ->
* wq.likeRight("title", query).or().likeRight("project", query));
*
*
*
* IPage<QyzxAttaFpgl> qyzxAttaFpglPage =
* QyzxAttaFpgl.builder().build().selectPage(page, queryWrapper);
* List<QyzxAttaFpgl> qyzxAttaFpgls = qyzxAttaFpglPage.getRecords();
* qyzxAttaFpglPage.getCurrent(); qyzxAttaFpglPage.getPages();
* qyzxAttaFpglPage.getTotal(); qyzxAttaFpglPage.getSize();
*
*
* return ResultUtil.data(page, qyzxAttaFpgls, "发票资料查询成功"); }
*/
@Autowired
private OSSUtil oss;
// 下载系统使用手册 直接提供(OSS公共读权限文件)url地址到前端按钮
/**
* 意见反馈
*/
/*
* @PostMapping(value = "/feedback")
*
* @ApiOperation(value = "意见反馈", httpMethod = "POST", notes = "接口发布说明") public
* Result<QyzxSuggestionFeeback> feedback(@CurrentUser UserBean userBean,
*
* @RequestParam(required = false) String opinionText, @RequestParam(required =
* false) String moudle,
*
* @Param("files") List<MultipartFile> files) { String url = null; List<String>
* list = new ArrayList<String>(); if (files != null) { for (MultipartFile file
* : files) { String path = "8timer2.0/" + userBean.getOrgCode() + "/" + moudle
* + "/" + file.getOriginalFilename(); if (file == null || file.getSize() <= 0)
* { return ResultUtil.error("上传的文件为空,请重新选择!"); } else { try { url =
* oss.uploadFile(path, file.getInputStream()); list.add(url); } catch
* (IOException e) { e.printStackTrace(); } } } } QyzxSuggestionFeeback feeback
* = new QyzxSuggestionFeeback(); feeback.setEmpNum(userBean.getEmpNum());
* feeback.setOpinionText(opinionText); feeback.setCreateTime(new Date());
* feeback.setOrgCode(userBean.getOrgCode()); boolean a = feeback.insert(); if
* (a && list.size() > 0) { for (String opinionUrl : list) {
* QyzxFeebackAccessory.builder().feebackId(feeback.getId()).opinionUrl(
* opinionUrl).build().insert(); } } return ResultUtil.success("意见反馈成功!"); }
*/
/**
* 意见反馈2
*/
@PostMapping(value = "/feedback")
@ApiOperation(value = "意见反馈", httpMethod = "POST", notes = "接口发布说明")
public Result<QyzxSuggestionFeeback> feedback(@CurrentUser UserBean userBean,
@RequestParam(required = false) String opinionText, @RequestParam(required = false) String moudle,
@Param("files") List<MultipartFile> files) {
String url = null;
List<String> list = new ArrayList<String>();
if (files != null) {
for (MultipartFile file : files) {
String path = "8timer2.0/" + userBean.getOrgCode() + "/" + moudle + "/" + file.getOriginalFilename();
if (file == null || file.getSize() <= 0) {
return ResultUtil.error("上传的文件为空,请重新选择!");
} else {
try {
url = OSSUtil.uploadFile(path, file.getInputStream());
list.add(url);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
QyzxSuggestionFeeback feeback = new QyzxSuggestionFeeback();
feeback.setEmpNum(userBean.getEmpNum());
feeback.setOpinionText(opinionText);
feeback.setCreateTime(new Date());
feeback.setOrgCode(userBean.getOrgCode());
boolean a = feeback.insert();
if (a && list.size() > 0) {
for (String opinionUrl : list) {
QyzxFeebackAccessory.builder().feebackId(feeback.getId()).opinionUrl(opinionUrl).build().insert();
public Result<String> feedback(@CurrentUser UserBean userBean, @RequestBody FeebackDto feebackDto) {
String opinionText = feebackDto.getOpinionText();
List<String> urlList = feebackDto.getUrlList();
QyzxSuggestionFeeback qs = QyzxSuggestionFeeback.builder().orgCode(userBean.getOrgCode()).empNum(userBean.getEmpNum()).opinionText(opinionText).bugType(1).createTime(new Date()).build();
boolean tof = qs.insert();
Integer feebackId = qs.getId();
if (tof) {
for (String str : urlList) {
QyzxFeebackAccessory.builder().feebackId(feebackId).opinionUrl(str).build().insert();
}
return ResultUtil.data("意见反馈成功!");
}
return ResultUtil.success("意见反馈成功!");
return ResultUtil.data("意见反馈失败!");
}
/**
......
......@@ -67,6 +67,7 @@ import cn.timer.api.dao.spmk.SpmkSpzMapper;
import cn.timer.api.dto.spmk.ApprovingDto;
import cn.timer.api.dto.spmk.FlowChildren;
import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.dto.spmk.MySummaryQueryDto;
import cn.timer.api.dto.spmk.Router;
import cn.timer.api.dto.spmk.Spmk;
import cn.timer.api.dto.spmk.SpmkApprovalTemplateDto;
......@@ -83,7 +84,7 @@ import cn.timer.api.dto.spmk.SpmkSpzSpglDto;
import cn.timer.api.dto.spmk.SummaryQueryDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.RouterUtils;
import cn.timer.api.utils.router.RouterUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -805,6 +806,7 @@ public class SpmkServiceImpl {
.title(spmkApproveSummaryDto.getTitle())
.initiator(spmkApproveSummaryDto.getInitiator())
.approveName(spmkApproveSummaryDto.getApproveName())
.assoType(spmkApproveSummaryDto.getAssoType())
.sts(0)
.currentApprover(currentApprover).build();
......@@ -844,10 +846,26 @@ public class SpmkServiceImpl {
summaryQueryDto.getCurrentPage() == null ? 1 : summaryQueryDto.getCurrentPage(),
summaryQueryDto.getTotalPage() == null ? 10 : summaryQueryDto.getTotalPage());
summaryQueryDto.setOrgCode(userBean.getOrgCode());
Integer deptId = summaryQueryDto.getDeptId();
List<YgglMainEmp> listYgglMainEmp = RouterUtils.selectOtherlistent(userBean.getOrgCode(), deptId);
Console.log("listYgglMainEmp:"+ listYgglMainEmp);
if (deptId != null && (listYgglMainEmp == null || listYgglMainEmp.size() == 0)) {
return ResultUtil.data(new ArrayList<SpmkApproveSummary>(), "操作成功!");
}
List<Integer> empNums = new ArrayList<Integer>();
for (YgglMainEmp ygglMainEmp : listYgglMainEmp) {
empNums.add(ygglMainEmp.getEmpNum());
}
summaryQueryDto.setEmpNums(empNums);
// 缺-部门id 搜索
List<SpmkApproveSummary> listAs = spmkApproveSummaryMapper.selectPageByQuery(page, summaryQueryDto);
IPage<SpmkApproveSummary> pageAs = spmkApproveSummaryMapper.selectPageByQuery(page, summaryQueryDto);
List<SpmkApproveSummary> listAs = pageAs.getRecords();
return ResultUtil.data(listAs, "操作成功!");
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
//TODO 审批详情
......@@ -866,10 +884,10 @@ public class SpmkServiceImpl {
BeanUtil.copyProperties(ad, adD, "requestData","froms","router","spmkApproveExecuteRecord");
adD.setRequestData(ObjectUtil.unserialize(ad.getRequestData()));
adD.setFroms(ObjectUtil.unserialize(ad.getFroms()));
adD.setFroms((List<JSONObject>)ObjectUtil.unserialize(ad.getFroms()));
adD.setRouter((Router)ObjectUtil.unserialize(ad.getRouter()));
adD.setListFlowChildren((List<FlowChildren>)ObjectUtil.unserialize(ad.getFlowChildren()));
adD.setListSpmkApproveExecuteRecord(listAer);
adD.setFlowChildren((List<FlowChildren>)ObjectUtil.unserialize(ad.getFlowChildren()));
adD.setApproveExecuteRecord(listAer);
return ResultUtil.data(adD, "操作成功!");
}
......@@ -887,6 +905,16 @@ public class SpmkServiceImpl {
.lambda()
.eq(SpmkApproveDetail::getApproveSummaryId, approvingDto.getAsId()));
// 查询 SpmkApproveSummary 状态
SpmkApproveSummary aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts)
.eq(SpmkApproveSummary::getId, approvingDto.getAsId()));
if (aSummary.getSts() == 2 || aSummary.getSts() == 3) {
return ResultUtil.error("该审批已结束!");
}
// 查询该 审批的状态 是否为 1 审批中
Integer count = SpmkExecutor.builder().build().selectCount(new QueryWrapper<SpmkExecutor>().lambda()
.eq(SpmkExecutor::getId, approvingDto.getExecutorId())
.eq(SpmkExecutor::getSts, "1"));
......@@ -895,7 +923,6 @@ public class SpmkServiceImpl {
return ResultUtil.error("您已审批过!");
}
SpmkApproveSummary aSummary = spmkApproveSummaryMapper.selectById(approvingDto.getAsId());
if (aSummary.getSts() == 0) {
List<FlowChildren> listFlowChildren = (List<FlowChildren>)ObjectUtil.unserialize(ad.getFlowChildren());
RouterUtils.approving(
......@@ -909,21 +936,60 @@ public class SpmkServiceImpl {
System.out.println(listFlowChildren);
// 更新 flowChildren
SpmkApproveDetail.builder().id(ad.getId()).flowChildren(ObjectUtil.serialize(listFlowChildren)).build().updateById();
if (CollUtil.getLast(listFlowChildren).getExecute() == "2") {
// 更新 审批汇总 状态
SpmkApproveSummary.builder().id(approvingDto.getAsId()).endTime(new Date()).sts(2).build().updateById();
FlowChildren fc = CollUtil.getLast(listFlowChildren);
if (fc.getExecute() == "2") {
// 查询 SpmkApproveSummary 状态
aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts)
.eq(SpmkApproveSummary::getId, approvingDto.getAsId()));
if (aSummary.getSts() != 3) {
SpmkApproveSummary.builder().id(approvingDto.getAsId()).endTime(new Date()).sts(2).build().updateById();
}
}
}else {
return ResultUtil.error("该审批已结束!");
}
return ResultUtil.data(null, "操作成功!");
}
//TODO 我审批的/抄送我的
/**
* 查询列表-我审批的/抄送我的-分页
*/
@PostMapping(value = "/select_my_approve")
@ApiOperation(value = "21.查询列表-我审批的/抄送我的-分页", httpMethod = "POST", notes = "查询列表-我审批的-关键字、审批状态、发起时间-分页")
@ApiOperationSupport(order = 18)
public Result<Object> selectMyAs(@CurrentUser UserBean userBean, @RequestBody MySummaryQueryDto mySummaryQueryDto) {
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(
mySummaryQueryDto.getCurrentPage() == null ? 1 : mySummaryQueryDto.getCurrentPage(),
mySummaryQueryDto.getTotalPage() == null ? 10 : mySummaryQueryDto.getTotalPage());
mySummaryQueryDto.setOrgCode(userBean.getOrgCode());
mySummaryQueryDto.setEmpNum(userBean.getEmpNum());
// 缺-部门id 搜索
IPage<SpmkApproveSummary> pageAs = spmkApproveSummaryMapper.selectPageByQueryForEmpNum(page, mySummaryQueryDto);
List<SpmkApproveSummary> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
/**
* 删除-审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据
*/
@DeleteMapping(value = "/delete_approval_data")
@ApiOperation(value = "90.(开发使用)删除-审批数据", httpMethod = "DELETE", notes = "审批汇总、审批详情、审批执行记录、审批执行人记录 所有数据")
@ApiOperationSupport(order = 10)
public Result<Object> deleteApprovalData(@CurrentUser UserBean userBean){
spmkApproveSummaryMapper.delete(null);
spmkApproveDetailMapper.delete(null);
spmkApproveExecuteRecordMapper.delete(null);
spmkExecutorMapper.delete(null);
return ResultUtil.data(null, "操作成功!");
}
}
......@@ -8,7 +8,9 @@ import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.dzht.DzhtAssoHtmb;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.dto.spmk.MySummaryQueryDto;
import cn.timer.api.dto.spmk.SummaryQueryDto;
/**
......@@ -19,6 +21,8 @@ import cn.timer.api.dto.spmk.SummaryQueryDto;
@Repository
public interface SpmkApproveSummaryMapper extends BaseMapper<SpmkApproveSummary> {
List<SpmkApproveSummary> selectPageByQuery(IPage<SpmkApproveSummary> page,@Param("param") SummaryQueryDto summaryQueryDto);
IPage<SpmkApproveSummary> selectPageByQuery(IPage<SpmkApproveSummary> page,@Param("param") SummaryQueryDto summaryQueryDto);
IPage<SpmkApproveSummary> selectPageByQueryForEmpNum(IPage<SpmkApproveSummary> page,@Param("param") MySummaryQueryDto mySummaryQueryDto);
}
/**
* @date 2020年4月27日
* @author 翁东州
* @方法中文名称:
*/
package cn.timer.api.dto.qyzx;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @date 2020年4月27日
* @author 翁东州
* @方法中文名称:
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class FeebackDto implements Serializable{
/**
* @date 2020年4月27日
* @author 翁东州
* @方法中文名称:
*/
private static final long serialVersionUID = 4457381912053961473L;
@ApiModelProperty(value = "填写内容", example = "13129310893")
private String opinionText;
@ApiModelProperty(value = "附件地址", example = "123456")
private List<String> urlList;
}
package cn.timer.api.dto.spmk;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MySummaryQueryDto extends Page{
private Integer orgCode;
private Integer empNum;
@ApiModelProperty(value = "关键字", example = "请假")
private String query;
@ApiModelProperty(value = "状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝", example = "0")
private Integer sts;
@ApiModelProperty(value = "开始时间 ", example = "2000-10-10 10:10:10")
private String startTime;
@ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10")
private String endTime;
@ApiModelProperty(value = "1抄送人 2审批人 3连续多级主管", example = "0")
private Integer type;
}
......@@ -32,15 +32,15 @@ public class SpmkApproveDetailDto {
private JSONObject requestData;
@ApiModelProperty(value = "审批表单 ", example = "审批表单")
private JSONObject froms;
private List<JSONObject> froms;
@ApiModelProperty(value = "审批流程 ", example = "审批流程")
private Router router;
@ApiModelProperty(value = "通过节点", example = "通过节点")
private List<FlowChildren> listFlowChildren;
private List<FlowChildren> flowChildren;
@ApiModelProperty(value = "审批执行记录 ", example = "审批执行记录")
private List<SpmkApproveExecuteRecord> listSpmkApproveExecuteRecord;
private List<SpmkApproveExecuteRecord> approveExecuteRecord;
}
......@@ -32,8 +32,9 @@ public class SpmkApproveSummaryDto{
@ApiModelProperty(value = "发起人名称 ", example = "发起人名称")
private String initiator;
@ApiModelProperty(value = "关联类型 1转正 2离职 3调薪 4调岗 5加班 6请假 7出差 8外出 9补卡", example = "5")
private Integer assoType;
@ApiModelProperty(value = "申请数据 ", example = "申请数据")
private JSONObject requestData;
......
package cn.timer.api.dto.spmk;
import java.util.List;
import cn.hutool.json.JSONObject;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -15,16 +18,21 @@ public class SummaryQueryDto extends Page{
private Integer orgCode;
@ApiModelProperty(value = "关键字", example = "请假")
private String query;
@ApiModelProperty(value = "部门id", example = "10")
private Integer deptId;
@ApiModelProperty(value = "状态 0审批中 1审批撤销 2审批通过/审批完成 3审批拒绝", example = "0")
private Integer sts;
@ApiModelProperty(value = "开始时间 ", example = "2000-10-10 10:10:10")
private String startTime;
@ApiModelProperty(value = "结束时间 ", example = "2020-10-10 10:10:10")
private String endTime;
private String[] empNums;
private List<Integer> empNums;
}
package cn.timer.api.utils.router;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public abstract class Compare {
protected String strA = "";
protected String strB = "";
public abstract boolean GetResutl();
}
package cn.timer.api.utils.router;
public class CompareFactory{
public static Compare createCompare(String strA, String strB, String compare) {
Compare comp = null;
switch (compare) {
case "<":
comp = new LtCompare(strA,strB);
break;
case "<=":
comp = new LtOREqualCompare(strA,strB);
break;
case "=":
comp = new EqualCompare(strA,strB);
break;
case ">":
comp = new GtCompare(strA,strB);
break;
case ">=":
comp = new GtOREqualCompare(strA,strB);
break;
default :
comp = new EqualCompare(strA,strB);
break;
}
return comp;
}
}
package cn.timer.api.utils.router;
public class EqualCompare extends Compare {
public EqualCompare() {
super();
}
public EqualCompare(String strA, String strB) {
super(strA, strB);
}
@Override
public boolean GetResutl() {
return strA.equals(strB) ? true : false;
}
}
package cn.timer.api.utils.router;
import cn.hutool.core.util.NumberUtil;
public class GtCompare extends Compare {
public GtCompare(){
super();
}
public GtCompare(String strA, String strB){
super(strA,strB);
}
@Override
public boolean GetResutl() {
return NumberUtil.compare(Double.parseDouble(strA),Double.parseDouble(strB)) == 1
? true : false;
}
}
package cn.timer.api.utils.router;
import cn.hutool.core.util.NumberUtil;
public class GtOREqualCompare extends Compare {
public GtOREqualCompare() {
super();
}
public GtOREqualCompare(String strA, String strB) {
super(strA,strB);
}
@Override
public boolean GetResutl() {
double d1 = Double.parseDouble(strA);
double d2 = Double.parseDouble(strB);
return NumberUtil.compare(d1,d2) >= 0
? true : false;
}
}
package cn.timer.api.utils.router;
import cn.hutool.core.util.NumberUtil;
public class LtCompare extends Compare {
public LtCompare(){
super();
}
public LtCompare(String strA, String strB){
super(strA,strB);
}
@Override
public boolean GetResutl() {
return NumberUtil.compare(Double.parseDouble(strA),Double.parseDouble(strB)) == -1
? true : false;
}
}
package cn.timer.api.utils.router;
import cn.hutool.core.util.NumberUtil;
import lombok.Data;
public class LtOREqualCompare extends Compare {
public LtOREqualCompare(){
super();
}
public LtOREqualCompare(String strA, String strB){
super(strA,strB);
}
@Override
public boolean GetResutl() {
double d1 = Double.parseDouble(strA);
double d2 = Double.parseDouble(strB);
return NumberUtil.compare(d1,d2) <= 0
? true : false;
}
}
package cn.timer.api.utils;
package cn.timer.api.utils.router;
import java.util.ArrayList;
import java.util.Date;
......@@ -180,11 +180,15 @@ public class RouterUtils {
routerRule.setFlow(true);
}else {
for (Condition condition : listCondition) {
Compare compare ;
for (String string : condition.getValues()) {
// 判断条件
if (!stringCompare(obj.get(condition.getKey(),FromData.class).getValue(), string , condition.getFormat())) {
// 简单工厂模式 - 判断条件
compare = CompareFactory.createCompare(obj.get(condition.getKey(),FromData.class).getValue(), string, condition.getFormat());
if (!compare.GetResutl()) {
condition_b = false;
}
}
}
}
......@@ -285,9 +289,6 @@ public class RouterUtils {
}else if (listRouter.size() > 1) {
for (Router router2 : listRouter) {
if (router2.getFlow()) {
// FlowChildren fc = FlowChildren.builder().build();
// BeanUtil.copyProperties(router2, fc, "condition","children");
// listFlowChildren.add(fc);
getIsFlowChildren(router2.getChildren(), listFlowChildren);
}
}
......@@ -439,6 +440,14 @@ public class RouterUtils {
if (sts == 3) {
// 更新 审批汇总 状态
SpmkApproveSummary.builder().id(asId).endTime(new Date()).sts(sts).build().updateById();
SpmkApproveExecuteRecord
.builder()
.id(executeRecordId)
.sts(sts)
.build()
// 更新 审批执行记录
.updateById();
listFlowChildren.get(i_user).setExecute(EXECUTED);
return;
}
}else if (UNEXECUTED.equals(listUser.get(i_user).getExecute())) {
......@@ -454,9 +463,13 @@ public class RouterUtils {
// 当前审批人
SpmkApproveSummary.builder().id(asId).currentApprover(listUser.get(i_user).getName()).build().updateById();
// 处理了 下一个审批人 则跳出循环
break;
}
}
// 无下一个审批人 则更新 节点状态 为 EXECUTED(已执行)
if (!hasNextApprover) {
SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord
.builder()
......
......@@ -15,6 +15,7 @@
<result column="sts" property="sts" />
<result column="current_approver" property="currentApprover" />
<result column="history_approver" property="historyApprover" />
<result column="asso_type" property="assoType" />
<result column="update_time" property="updateTime" />
<result column="end_time" property="endTime" />
<result column="digest" property="digest" />
......@@ -32,6 +33,7 @@
sts,
current_approver,
history_approver,
asso_type,
update_time,
end_time,
digest
......@@ -49,6 +51,7 @@
a.sts,
a.current_approver,
a.history_approver,
a.asso_type,
a.update_time,
a.end_time,
a.digest
......@@ -66,6 +69,7 @@
sts SpmkApproveSummary_sts,
current_approver SpmkApproveSummary_current_approver,
history_approver SpmkApproveSummary_history_approver,
asso_type SpmkApproveSummary_asso_type,
update_time SpmkApproveSummary_update_time,
end_time SpmkApproveSummary_end_time,
digest SpmkApproveSummary_digest
......@@ -74,11 +78,11 @@
<select id="selectPageByQuery" resultMap="BaseResultMap" >
SELECT
<include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num)) as gw_name,
(SELECT id FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num) )) as bm_id,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num) )) as bm_name
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) as gw_name,
(SELECT id FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) limit 1) as bm_id,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) limit 1) as bm_name
FROM spmk_approve_summary a
WHERE 1 = 1
WHERE a.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''">
and (
a.title like CONCAT(#{param.query},'%') or
......@@ -86,12 +90,65 @@
a.id like CONCAT(#{param.query},'%')
)
</if>
<if test="param.sts != null and param.sts != ''">
and a.sts = #{param.sts}
</if>
<if test="param.startTime != null and param.startTime != ''">
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and qlb.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
<if test="param.empNums != null and param.empNums.size() > 0">
and a.emp_num IN
(
<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
#{it}
</foreach>
)
</if>
ORDER BY a.id DESC
</select>
<select id="selectPageByQueryForEmpNum" resultMap="BaseResultMap" >
SELECT
<include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) as gw_name,
(SELECT id FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) limit 1) as bm_id,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = (SELECT bmgw_id FROM yggl_main_emp WHERE a.emp_num = emp_num limit 1) limit 1) limit 1) as bm_name
FROM spmk_approve_summary a
WHERE a.org_code = #{param.orgCode}
<if test="param.type != null and param.type >= 1">
and a.id in
(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}
)
</if>
<if test="param.type != null and param.type == 0">
and a.emp_num = #{param.empNum}
</if>
<if test="param.sts != null and param.sts != ''">
and a.sts = #{param.sts}
</if>
<if test="param.query != null and param.query != ''">
and (
a.title like CONCAT(#{param.query},'%') or
a.initiator like CONCAT(#{param.query},'%') or
a.id like CONCAT(#{param.query},'%')
)
</if>
<if test="param.startTime != null and param.startTime != ''">
and a.create_time <![CDATA[ >= ]]> #{param.startTime}
</if>
<if test="param.endTime != null and param.endTime != ''">
and qlb.create_time <![CDATA[ <= ]]> #{param.endTime}
</if>
ORDER BY a.id DESC
</select>
......@@ -130,6 +187,9 @@
<if test ='null != historyApprover'>
history_approver,
</if>
<if test ='null != assoType'>
asso_type,
</if>
<if test ='null != updateTime'>
update_time,
</if>
......@@ -171,6 +231,9 @@
<if test ='null != historyApprover'>
#{historyApprover},
</if>
<if test ='null != assoType'>
#{assoType},
</if>
<if test ='null != updateTime'>
#{updateTime},
</if>
......@@ -201,6 +264,7 @@
<if test ='null != sts'>sts = #{sts},</if>
<if test ='null != currentApprover'>current_approver = #{currentApprover},</if>
<if test ='null != historyApprover'>history_approver = #{historyApprover},</if>
<if test ='null != assoType'>asso_type = #{assoType},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != endTime'>end_time = #{endTime},</if>
<if test ='null != digest'>digest = #{digest}</if>
......
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