-报价中标流程发起,中标回调

new
Agoni 1 year ago
parent dd2ca3e24b
commit 55e0897633

@ -144,7 +144,7 @@ public class QuotationSheetController {
@PostMapping("/approvalBidding")
@Operation(summary = "中标审批发起接口")
// @PreAuthorize("@ss.hasPermission('bs:quotation-sheet:approvalBidding')")
public CommonResult<String> approvalBidding(QuotationSheetPageReqVO pageVO) {
public CommonResult<String> approvalBidding(QuotationSheetUpdateReqVO pageVO) {
return success(quotationSheetService.approvalBidding(pageVO));
}

@ -98,8 +98,6 @@ public class QuotationSheetBaseVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime applyTime;
@Schema(description = "申请人")
private Long applicant;
@ -109,4 +107,6 @@ public class QuotationSheetBaseVO {
@Schema(description = "采购预算")
private String money;
private String processId;
}

@ -108,4 +108,6 @@ public class QuotationSheetExcelVO {
@Schema(description = "采购预算")
private String money;
private String processId;
}

@ -97,7 +97,7 @@ public class QuotationSheetExportReqVO {
@Schema(description = "申请人")
private Long applicant;
private String processId;
@Schema(description = "申请人部门id", example = "10907")
private Long deptId;

@ -116,4 +116,6 @@ public class QuotationSheetPageReqVO extends PageParam {
@Schema(description = "供应商中标id集合发起审批的时候添加此参数")
private List<Long> approvalBiddingIdList;
private String processId;
}

@ -65,4 +65,6 @@ public class QuotationSheetRespVO extends QuotationSheetBaseVO {
*/
private Long tenantId;
private String tenantName;
private String processId;
}

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheet.vo;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingBaseVO;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetdetail.QuotationSheetDetailDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
@ -22,7 +24,14 @@ public class QuotationSheetUpdateReqVO extends QuotationSheetBaseVO {
@NotEmpty(message = "物料不能为空")
private List<QuotationSheetDetailDO> quotationDetails;
/**
*
*/
// @NotEmpty(message = "物料不能为空")
private List<QuotationSheetBiddingDO> quotationSheetBiddingDOList;
@Schema(description = "是否中标")
private Integer isWin;
private String processId;
}

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding;
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.*;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -8,7 +9,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
@ -23,10 +23,10 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo.*;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO;
import cn.iocoder.yudao.module.bs.convert.quotationsheetbidding.QuotationSheetBiddingConvert;
import cn.iocoder.yudao.module.bs.service.quotationsheetbidding.QuotationSheetBiddingService;
import cn.iocoder.yudao.module.bpm.convert.quotationsheetbidding.QuotationSheetBiddingConvert;
import cn.iocoder.yudao.module.bpm.service.quotationsheetbidding.QuotationSheetBiddingService;
@Tag(name = "管理后台 - 报价单物料中标")
@RestController

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo;
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import io.swagger.v3.oas.annotations.media.Schema;

@ -1,9 +1,7 @@
package cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo;
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 报价单物料中标创建 Request VO")
@Data

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo;
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import io.swagger.v3.oas.annotations.media.Schema;

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo;
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import lombok.*;

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo;
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo;
import cn.iocoder.yudao.framework.common.pojo.ImageVo;
import lombok.*;

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo;
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo;
package cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 报价单物料中标更新 Request VO")

@ -1,12 +1,15 @@
package cn.iocoder.yudao.module.bs.convert.quotationsheetbidding;
package cn.iocoder.yudao.module.bpm.convert.quotationsheetbidding;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingCreateReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingExcelVO;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingUpdateReqVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo.*;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO;
/**

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.bs.dal.mysql.quotationsheetbidding;
package cn.iocoder.yudao.module.bpm.dal.mysql.quotationsheetbidding;
import java.util.*;
@ -7,7 +7,6 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo.*;
/**
* Mapper

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.bpm.service.oa.listener;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
import cn.iocoder.yudao.module.bpm.service.quotationsheet.QuotationSheetService;
import cn.iocoder.yudao.module.bpm.service.quotationsheet.QuotationSheetServiceImpl;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
*
* @author MrFang
* @date 20230828 10:42
*/
@Component
public class QuotationSheetBiddingResultListener extends BpmProcessInstanceResultEventListener{
@Resource
private QuotationSheetService quotationSheetService;
@Override
protected String getProcessDefinitionKey() {
return QuotationSheetServiceImpl.BIDDING_KEY;
}
@Override
protected void onEvent(BpmProcessInstanceResultEvent event) {
quotationSheetService.processInstanceCallBack2(Long.parseLong(event.getBusinessKey()), event.getResult());
}
}

@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheet.vo.QuotationS
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheet.QuotationSheetDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import com.github.yulichang.base.MPJBaseService;
import liquibase.pro.packaged.S;
/**
* Service
@ -22,6 +23,9 @@ public interface QuotationSheetService extends MPJBaseService<QuotationSheetDO>
//报价单流程ID
public static final String PROCESS_KEY = "quotation_sheet_seq";
//报价单中标流程
public static final String BIDDING_KEY = "quotation_sheet_bidding";
/**
*
*
@ -89,7 +93,7 @@ public interface QuotationSheetService extends MPJBaseService<QuotationSheetDO>
* @param pageVO
* @return
*/
String approvalBidding(QuotationSheetPageReqVO pageVO);
String approvalBidding(QuotationSheetUpdateReqVO pageVO);
/**
*
@ -99,12 +103,19 @@ public interface QuotationSheetService extends MPJBaseService<QuotationSheetDO>
PageResult<QuotationSheetDO> tendereeQuery(QuotationSheetPageReqVO pageVO);
/**
*
*
* @param id
* @param result
*/
void processInstanceCallBack(long id, Integer result);
/**
*
* @param id
* @param result
*/
void processInstanceCallBack2(long id, Integer result);
void setNickNameField(List<QuotationSheetDO> list);

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bpm.service.quotationsheet;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.security.core.LoginUser;
@ -10,13 +11,15 @@ import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheet.vo.QuotationS
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheet.vo.QuotationSheetPageReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheet.vo.QuotationSheetUpdateReqVO;
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
import cn.iocoder.yudao.module.bs.dal.dataobject.materiel.MaterielDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetdetail.QuotationSheetDetailDO;
import cn.iocoder.yudao.module.bs.enums.QuotationSheetBiddingEnum;
import cn.iocoder.yudao.module.bs.enums.QuotationSheetEnum;
import cn.iocoder.yudao.module.bs.dal.dataobject.suppliercompany.SupplierCompanyDO;
import cn.iocoder.yudao.module.bs.service.materiel.MaterielService;
import cn.iocoder.yudao.module.bs.service.quotationsheetbidding.QuotationSheetBiddingService;
import cn.iocoder.yudao.module.bpm.service.quotationsheetbidding.QuotationSheetBiddingService;
import cn.iocoder.yudao.module.bs.service.quotationsheetdetail.QuotationSheetDetailService;
import cn.iocoder.yudao.module.bs.service.suppliercompany.SupplierCompanyService;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
@ -26,9 +29,12 @@ import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.yulichang.base.MPJBaseServiceImpl;
import liquibase.pro.packaged.S;
import org.flowable.engine.runtime.ProcessInstance;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -86,6 +92,9 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
@Resource
private TenantApi tenantApi;
@Resource
private BpmProcessInstanceService processInstanceService;
@Override
public Long createQuotationSheet(QuotationSheetCreateReqVO createReqVO) {
// 插入
@ -98,6 +107,7 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
quotationSheet.setApplicant(loginUser.getId());
quotationSheet.setQuotationStatus(1);
quotationSheet.setReleaseStatus(1);
quotationSheet.setBiddingStatus(QuotationSheetBiddingEnum.NO_CONFIRM.getValue());
quotationSheet.setStatus("0");
saveOrUpdate(quotationSheet);
if (createReqVO.getQuotationDetails().size() > 0){
@ -430,7 +440,21 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
}
@Override
public String approvalBidding(QuotationSheetPageReqVO pageVO) {
public String approvalBidding(QuotationSheetUpdateReqVO pageVO) {
QuotationSheetDO questionDO = this.getById(pageVO.getId());
//发起实例
if (questionDO.getBiddingStatus().equals(QuotationSheetBiddingEnum.NO_CONFIRM.getValue())) {
Map<String, Object> variables = new HashMap<>();
variables.put("bidding", JSON.toJSONString(pageVO.getQuotationSheetBiddingDOList()));
//variables.put("name", quotationSheet.getProductName());
// variables.put("number",quotationSheet.getNumber());
// variables.put("deptId", quotationSheet.getDeptId());
String processInstanceId = processInstanceApi.createProcessInstance(questionDO.getApplicant(),
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
.setVariables(variables).setBusinessKey(String.valueOf(questionDO.getId())));
updateById(new QuotationSheetDO().setId(questionDO.getId()).setProcessId(processInstanceId));
return processInstanceId;
}
return null;
}
@ -468,6 +492,36 @@ public class QuotationSheetServiceImpl extends MPJBaseServiceImpl<QuotationSheet
apply.setStatus(QuotationSheetEnum.APPROVE.getValue());
updateById(apply);
}
}
@Override
public void processInstanceCallBack2( long id, Integer result) {
QuotationSheetDO quotationShe = getById(id);
ProcessInstance proces = processInstanceService.getProcessInstance(quotationShe.getProcessId());
// String ts= (String) ;
/* QuotationSheetBiddingDO quotationSheetBiddingDO = JsonUtil.parse(JsonUtil.toJson(proces.getProcessVariables().get("bidding")), QuotationSheetBiddingDO.class);
JSONArray jsonObject = JSON.parseObject(result1).getJSONArray("list")*/
System.out.println(">>>>>>>>"+proces.getProcessVariables().get("bidding"));
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
//通过
quotationShe.setBiddingStatus(QuotationSheetBiddingEnum.CONFIRM.getValue());
updateById(quotationShe);
} else if (BpmProcessInstanceResultEnum.REJECT.getResult().equals(result)) {
//驳回
quotationShe.setBiddingStatus(QuotationSheetBiddingEnum.ABANDON.getValue());
updateById(quotationShe);
}else if (BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result)) {
//驳回
quotationShe.setBiddingStatus(QuotationSheetBiddingEnum.NO_CONFIRM.getValue());
updateById(quotationShe);
}
}
@Override

@ -1,11 +1,14 @@
package cn.iocoder.yudao.module.bs.service.quotationsheetbidding;
package cn.iocoder.yudao.module.bpm.service.quotationsheetbidding;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo.*;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingCreateReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingExportReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingPageReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.quotationsheetbidding.vo.QuotationSheetBiddingUpdateReqVO;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bs.dal.dataobject.suppliercompany.SupplierCompanyDO;
import com.github.yulichang.base.MPJBaseService;
/**

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.bs.service.quotationsheetbidding;
package cn.iocoder.yudao.module.bpm.service.quotationsheetbidding;
import cn.iocoder.yudao.module.bs.dal.dataobject.suppliercompany.SupplierCompanyDO;
import cn.iocoder.yudao.module.bs.dal.mysql.suppliercompany.SupplierCompanyMapper;
import cn.iocoder.yudao.module.bs.service.suppliercompany.SupplierCompanyService;
import com.github.yulichang.base.MPJBaseServiceImpl;
import org.springframework.stereotype.Service;
@ -9,12 +8,12 @@ import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.module.bs.controller.admin.quotationsheetbidding.vo.*;
import cn.iocoder.yudao.module.bs.dal.dataobject.quotationsheetbidding.QuotationSheetBiddingDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bs.convert.quotationsheetbidding.QuotationSheetBiddingConvert;
import cn.iocoder.yudao.module.bs.dal.mysql.quotationsheetbidding.QuotationSheetBiddingMapper;
import cn.iocoder.yudao.module.bpm.convert.quotationsheetbidding.QuotationSheetBiddingConvert;
import cn.iocoder.yudao.module.bpm.dal.mysql.quotationsheetbidding.QuotationSheetBiddingMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.bs.enums.ErrorCodeConstants.*;

@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.bs.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
*
*/
@AllArgsConstructor
@Getter
public enum QuotationSheetBiddingEnum {
CONFIRM("1", "中标"),
NO_CONFIRM("2", "未中标"),
ABANDON("3", "流标"),
;
/**
*
*/
private final String value;
/**
*
*/
private final String name;
}

@ -178,6 +178,12 @@ public class QuotationSheetDO extends TenantBaseDO {
@TableField(exist = false)
private String biddingSupplierName;
/**
* ID
*/
private String processId;
/**
*
*/
@ -186,7 +192,7 @@ public class QuotationSheetDO extends TenantBaseDO {
/**
*
*/
private Integer biddingStatus;
private String biddingStatus;
private String money;

Loading…
Cancel
Save