11-25-更新收票登记

This commit is contained in:
2025-11-25 19:19:52 +08:00
parent 9eecf67374
commit 12d3924e8a
5 changed files with 141 additions and 74 deletions

View File

@ -1,26 +1,27 @@
package org.dromara.xzd.spykp.spdj.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.xzd.spykp.spdj.domain.vo.XzdSpykpSpdjVo;
import org.dromara.xzd.spykp.spdj.domain.bo.XzdSpykpSpdjBo;
import org.dromara.xzd.spykp.spdj.service.IXzdSpykpSpdjService;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.web.core.BaseController;
import org.dromara.xzd.spykp.spdj.domain.bo.XzdSpykpSpdjBo;
import org.dromara.xzd.spykp.spdj.domain.vo.XzdSpykpSpdjVo;
import org.dromara.xzd.spykp.spdj.service.IXzdSpykpSpdjService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 收票登记
@ -31,7 +32,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/spdj/spdj")
@RequestMapping("/xzd/spdj/spdj")
public class XzdSpykpSpdjController extends BaseController {
private final IXzdSpykpSpdjService xzdSpykpSpdjService;

View File

@ -252,5 +252,9 @@ public class XzdSpykpSpdj extends BaseEntity {
*/
private Long contractId;
/**
* 审核状态
*/
private String shzt;
}

View File

@ -250,5 +250,8 @@ public class XzdSpykpSpdjBo extends BaseEntity {
*/
private Long contractId;
/**
* 审核状态
*/
private String shzt;
}

View File

@ -4,6 +4,8 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.xzd.spykp.spdj.domain.XzdSpykpSpdj;
import java.io.Serial;
@ -190,6 +192,7 @@ public class XzdSpykpSpdjVo implements Serializable {
/**
* 销方(客户)名称
*/
@Translation(type = TransConstant.XZD_KHXX_ID_TO_NAME,mapper = "xfId")
private String xfmc;
/**
@ -323,4 +326,8 @@ public class XzdSpykpSpdjVo implements Serializable {
*/
private String contractName;
/**
* 审核状态
*/
private String shzt;
}

View File

@ -1,15 +1,18 @@
package org.dromara.xzd.spykp.spdj.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
import org.dromara.common.core.domain.event.ProcessEvent;
import org.dromara.common.core.domain.event.ProcessTaskEvent;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.system.domain.vo.SysDeptVo;
import org.dromara.system.domain.vo.SysUserVo;
import org.dromara.system.service.impl.SysDeptServiceImpl;
@ -17,22 +20,23 @@ import org.dromara.system.service.impl.SysOssServiceImpl;
import org.dromara.system.service.impl.SysUserServiceImpl;
import org.dromara.xzd.domain.XzdContractDetails;
import org.dromara.xzd.domain.XzdProject;
import org.dromara.xzd.domain.dto.QuerCorrespondentDto;
import org.dromara.xzd.service.IXzdCorrespondentList;
import org.dromara.xzd.service.impl.XzdContractDetailsServiceImpl;
import org.dromara.xzd.service.impl.XzdProjectServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.dromara.xzd.spykp.spdj.domain.XzdSpykpSpdj;
import org.dromara.xzd.spykp.spdj.domain.bo.XzdSpykpSpdjBo;
import org.dromara.xzd.spykp.spdj.domain.vo.XzdSpykpSpdjVo;
import org.dromara.xzd.spykp.spdj.domain.XzdSpykpSpdj;
import org.dromara.xzd.spykp.spdj.mapper.XzdSpykpSpdjMapper;
import org.dromara.xzd.spykp.spdj.service.IXzdSpykpSpdjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 收票登记Service业务层处理
@ -42,6 +46,7 @@ import java.util.Collection;
*/
@RequiredArgsConstructor
@Service
@Slf4j
public class XzdSpykpSpdjServiceImpl extends ServiceImpl<XzdSpykpSpdjMapper, XzdSpykpSpdj> implements IXzdSpykpSpdjService {
private final XzdSpykpSpdjMapper baseMapper;
@ -173,44 +178,44 @@ public class XzdSpykpSpdjServiceImpl extends ServiceImpl<XzdSpykpSpdjMapper, Xzd
XzdSpykpSpdj update = MapstructUtils.convert(bo, XzdSpykpSpdj.class);
validEntityBeforeSave(update);
XzdSpykpSpdj old = baseMapper.selectById(update.getId());
// XzdSpykpSpdj old = baseMapper.selectById(update.getId());
//更新文件
if (bo.getFileId() != null && !bo.getFileId().isEmpty()){
if (old.getFileId() != null && !old.getFileId().isEmpty()) {
List<Long> oldFileId = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
List<Long> nowFileId = Arrays.stream(bo.getFileId().split(",")).map(Long::valueOf).toList();
for (Long l : oldFileId) {
if (!nowFileId.contains(l)) {
sysOssService.deleteWithValidByIds(List.of(l), false);
}
}
}
}else {
if (old.getFileId()!= null && !old.getFileId().isEmpty()){
List<Long> deleteIds = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
sysOssService.deleteWithValidByIds(deleteIds, false);
}
}
//发票图片
if (bo.getFptp() != null){
if (!bo.getFptp().equals(old.getFptp())){
sysOssService.deleteWithValidByIds(List.of(old.getFptp()), false);
}
}else {
if (old.getFptp()!= null){
sysOssService.deleteWithValidByIds(List.of(old.getFptp()), false);
}
}
//证明信息文件
if (bo.getZmxxwj() != null){
if (!bo.getZmxxwj().equals(old.getZmxxwj())){
sysOssService.deleteWithValidByIds(List.of(old.getZmxxwj()), false);
}
}else {
if (old.getZmxxwj()!= null){
sysOssService.deleteWithValidByIds(List.of(old.getZmxxwj()), false);
}
}
// if (bo.getFileId() != null && !bo.getFileId().isEmpty()){
// if (old.getFileId() != null && !old.getFileId().isEmpty()) {
// List<Long> oldFileId = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
// List<Long> nowFileId = Arrays.stream(bo.getFileId().split(",")).map(Long::valueOf).toList();
// for (Long l : oldFileId) {
// if (!nowFileId.contains(l)) {
// sysOssService.deleteWithValidByIds(List.of(l), false);
// }
// }
// }
// }else {
// if (old.getFileId()!= null && !old.getFileId().isEmpty()){
// List<Long> deleteIds = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
// sysOssService.deleteWithValidByIds(deleteIds, false);
// }
// }
// //发票图片
// if (bo.getFptp() != null){
// if (!bo.getFptp().equals(old.getFptp())){
// sysOssService.deleteWithValidByIds(List.of(old.getFptp()), false);
// }
// }else {
// if (old.getFptp()!= null){
// sysOssService.deleteWithValidByIds(List.of(old.getFptp()), false);
// }
// }
// //证明信息文件
// if (bo.getZmxxwj() != null){
// if (!bo.getZmxxwj().equals(old.getZmxxwj())){
// sysOssService.deleteWithValidByIds(List.of(old.getZmxxwj()), false);
// }
// }else {
// if (old.getZmxxwj()!= null){
// sysOssService.deleteWithValidByIds(List.of(old.getZmxxwj()), false);
// }
// }
return baseMapper.updateById(update) > 0;
}
@ -269,14 +274,14 @@ public class XzdSpykpSpdjServiceImpl extends ServiceImpl<XzdSpykpSpdjMapper, Xzd
}
}
//销方(客户id)
if (vo.getXfId() != null){
R<QuerCorrespondentDto> byid2 = iXzdCorrespondentList.getCustomerByid(vo.getXfId());
if (byid2 != null) {
if (byid2.getData().getXzdCustomerinformation() != null) {
vo.setXfmc(byid2.getData().getXzdCustomerinformation().getUnitName());
}
}
}
// if (vo.getXfId() != null){
// R<QuerCorrespondentDto> byid2 = iXzdCorrespondentList.getCustomerByid(vo.getXfId());
// if (byid2 != null) {
// if (byid2.getData().getXzdCustomerinformation() != null) {
// vo.setXfmc(byid2.getData().getXzdCustomerinformation().getUnitName());
// }
// }
// }
//经办人
if (vo.getJbrId() != null){
SysUserVo sysUserVo = sysUserService.selectUserById(vo.getJbrId());
@ -308,4 +313,51 @@ public class XzdSpykpSpdjServiceImpl extends ServiceImpl<XzdSpykpSpdjMapper, Xzd
}
}
/**
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
* 正常使用只需#processEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
* @param processEvent 参数
*/
@EventListener(condition = "#processEvent.flowCode.endsWith('XzdSpykpSpdj')")
@Transactional
public void processPlansHandler(ProcessEvent processEvent) {
log.info("收票登记审核任务执行了{}", processEvent.toString());
String id = processEvent.getBusinessId();
XzdSpykpSpdj byId = this.getById(Long.valueOf(id));
byId.setShzt(processEvent.getStatus());
boolean b = this.updateById(byId);
if (!b) {
log.error("收票登记审核任务更新状态失败");
}
}
/**
* 执行任务创建监听
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
* 在方法中判断流程节点key
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
* //执行业务逻辑
* }
*
* @param processTaskEvent 参数
*/
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('XzdSpykpSpdj')")
public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) {
log.info("收票登记审核任务创建了{}", processTaskEvent.toString());
}
/**
* 监听删除流程事件
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
* 示例为了方便则使用startsWith匹配了全部示例key
*
* @param processDeleteEvent 参数
*/
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('XzdSpykpSpdj')")
public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) {
log.info("承包合同计划删除流程事件{}", processDeleteEvent.toString());
}
}