供应商变更

This commit is contained in:
TL
2025-06-19 11:21:35 +08:00
parent 1a6440de59
commit 03e2115492
13 changed files with 217 additions and 18 deletions

View File

@ -6,9 +6,11 @@ import com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.entity.CoscoCategoryLibr
import com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.service.ICoscoCategoryLibraryService;
import com.chinaunicom.zyhy.ebtp.supplier.coscoCategory.service.ICoscoCategoryLibrarySupplierApplyService;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoAccessWork;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierChangeApply;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierexit;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.ICoscoAccessWorkCategoryService;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.ICoscoAccessWorkService;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.ICoscoSupplierBaseService;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.ICoscoSupplierexitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -35,6 +37,8 @@ public class SynchronousController {
@Autowired
private ICoscoSupplierexitService coscoSupplierexitService;
@Autowired
private ICoscoSupplierBaseService coscoSupplierBaseService;
@ -85,4 +89,13 @@ public class SynchronousController {
/**
* 供应商变更审批回调接口
*/
@PostMapping("/supplierChangeApprove")
public BaseResponse supplierChangeApprove(@RequestBody CoscoSupplierChangeApply vo) {
return BaseResponse.success(coscoSupplierBaseService.updateCoscoSupplierBase(vo));
}
}

View File

@ -3,6 +3,7 @@ package com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBank;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBase;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierChangeApply;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierVo;
import java.util.List;
@ -43,10 +44,9 @@ public interface ICoscoSupplierBaseService {
/**
* 修改中远海运_供应商_基本信息
*
* @param coscoSupplierBase 中远海运_供应商_基本信息
* @return 结果
*/
public int updateCoscoSupplierBase(CoscoSupplierBase coscoSupplierBase);
public Boolean updateCoscoSupplierBase(CoscoSupplierChangeApply vo);
/**
* 批量删除中远海运_供应商_基本信息

View File

@ -174,6 +174,11 @@ public class CoscoAccessWorkCategoryServiceImpl implements ICoscoAccessWorkCateg
//先验证一下主任务表数据状态
CoscoAccessWork coscoAccessWorkData = coscoAccessWorkMapper.selectCoscoAccessWorkById(vo.getId());
if(coscoAccessWorkData == null){
return true;
}
if(CoscoType.APPROVE_STATUS_TG.equals(coscoAccessWorkData.getApproveStatus()) ||
CoscoType.APPROVE_STATUS_BH.equals(coscoAccessWorkData.getApproveStatus()) ){
return true;

View File

@ -505,6 +505,11 @@ public class CoscoAccessWorkServiceImpl implements ICoscoAccessWorkService {
//先验证一下主任务表数据状态
CoscoAccessWork coscoAccessWorkData = coscoAccessWorkMapper.selectCoscoAccessWorkById(vo.getId());
if(coscoAccessWorkData == null){
return true;
}
if(CoscoType.APPROVE_STATUS_TG.equals(coscoAccessWorkData.getApproveStatus()) ||
CoscoType.APPROVE_STATUS_BH.equals(coscoAccessWorkData.getApproveStatus()) ){
return true;

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaunicom.mall.ebtp.common.util.PropertyUtils;
import com.chinaunicom.zyhy.ebtp.supplier.common.CoscoIdUtil;
import com.chinaunicom.zyhy.ebtp.supplier.common.CoscoType;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.dao.mapper.*;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.*;
import com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.service.ICoscoSupplierBaseService;
@ -53,6 +54,12 @@ public class CoscoSupplierBaseServiceImpl implements ICoscoSupplierBaseService {
@Autowired
private CoscoSupplierChangeBankMapper coscoSupplierChangeBankMapper;
//变更
@Autowired
private CoscoSupplierChangeApplyMapper coscoSupplierChangeApplyMapper;
@Override
public IPage<CoscoSupplierBase> getPage(CoscoSupplierBase coscoSupplierBase) {
// 创建分页对象(当前页,每页大小)
@ -258,15 +265,117 @@ public class CoscoSupplierBaseServiceImpl implements ICoscoSupplierBaseService {
}
/**
* 修改中远海运_供应商_基本信息
* 变更中远海运_供应商_基本信息
*
* @param coscoSupplierBase 中远海运_供应商_基本信息
* @return 结果
*/
@Override
public int updateCoscoSupplierBase(CoscoSupplierBase coscoSupplierBase) {
@Transactional
public Boolean updateCoscoSupplierBase(CoscoSupplierChangeApply vo) {
String appid = vo.getId();//任务主体id
CoscoSupplierChangeApply coscoSupplierChangeApply = coscoSupplierChangeApplyMapper.selectCoscoSupplierChangeApplyById(appid);
if(coscoSupplierChangeApply == null){
return true;
}
//先验证一下主任务表数据状态
if(CoscoType.APPROVE_STATUS_TG.equals(coscoSupplierChangeApply.getApproveStatus()) ||
CoscoType.APPROVE_STATUS_BH.equals(coscoSupplierChangeApply.getApproveStatus()) ){
return true;
}
//新基本信息
CoscoSupplierChangeBase newCoscoSupplierBase = coscoSupplierChangeBaseMapper.selectBySupplierChangeApplyId(appid);
//老基本信息
CoscoSupplierBase coscoSupplierBase = coscoSupplierBaseMapper.selectCoscoSupplierBaseById(coscoSupplierChangeApply.getSupplierId());
String supplierId = coscoSupplierBase.getId();
String createBy = coscoSupplierBase.getCreateBy();
String updateBy = coscoSupplierBase.getUpdateBy();
BeanUtil.copyProperties(newCoscoSupplierBase,coscoSupplierBase);
coscoSupplierBase.setId(supplierId);
coscoSupplierBase.setUpdateTime(CoscoDateUtils.getNowDate());
return coscoSupplierBaseMapper.updateCoscoSupplierBase(coscoSupplierBase);
coscoSupplierBase.setLastUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierBaseMapper.updateCoscoSupplierBase(coscoSupplierBase);
//删除在新增新资质
coscoSupplierQualificationsMapper.deleteCoscoSupplierQualificationsById(supplierId);
CoscoSupplierChangeQualifications coscoSupplierChangeQualifications2 = new CoscoSupplierChangeQualifications();
coscoSupplierChangeQualifications2.setSupplierId(newCoscoSupplierBase.getId());
List<CoscoSupplierChangeQualifications> newCoscoSupplierChangeQualificationsList =
coscoSupplierChangeQualificationsMapper.selectCoscoSupplierChangeQualificationsList(coscoSupplierChangeQualifications2);
for(CoscoSupplierChangeQualifications newQualifications : newCoscoSupplierChangeQualificationsList){
CoscoSupplierQualifications oldQualifications = new CoscoSupplierQualifications();
BeanUtil.copyProperties(newQualifications,oldQualifications);
String yId = CoscoIdUtil.getId();
oldQualifications.setId(yId);
oldQualifications.setSupplierId(supplierId);
oldQualifications.setCreateBy(createBy);
oldQualifications.setCreateTime(CoscoDateUtils.getNowDate());
oldQualifications.setUpdateBy(updateBy);
oldQualifications.setUpdateTime(CoscoDateUtils.getNowDate());
oldQualifications.setLastUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierQualificationsMapper.insertCoscoSupplierQualifications(oldQualifications);
//把新id添加到变更表
CoscoSupplierChangeQualifications coscoSupplierChangeQualifications = new CoscoSupplierChangeQualifications();
coscoSupplierChangeQualifications.setSupplierQualificationsId(yId);
coscoSupplierChangeQualifications.setId(newQualifications.getId());
coscoSupplierChangeQualificationsMapper.updateCoscoSupplierChangeQualifications(coscoSupplierChangeQualifications);
}
//新开票信息
coscoSupplierInvoiceMapper.deleteCoscoSupplierInvoiceById(supplierId);
CoscoSupplierChangeInvoice newInvoice = coscoSupplierChangeInvoiceMapper.selectBySupplierChangeApplyId(appid);
CoscoSupplierInvoice oldInvoice = new CoscoSupplierInvoice();
BeanUtil.copyProperties(newInvoice,oldInvoice);
oldInvoice.setId(CoscoIdUtil.getId());
oldInvoice.setSupplierId(supplierId);
oldInvoice.setCreateBy(createBy);
oldInvoice.setCreateTime(CoscoDateUtils.getNowDate());
oldInvoice.setUpdateBy(updateBy);
oldInvoice.setUpdateTime(CoscoDateUtils.getNowDate());
oldInvoice.setLastUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierInvoiceMapper.insertCoscoSupplierInvoice(oldInvoice);
//新银行
coscoSupplierBankMapper.deleteCoscoSupplierBankById(supplierId);
CoscoSupplierChangeBank newBank = new CoscoSupplierChangeBank();
newBank.setSupplierId(newCoscoSupplierBase.getId());
List<CoscoSupplierChangeBank> newBankList =
coscoSupplierChangeBankMapper.selectCoscoSupplierChangeBankList(newBank);
for(CoscoSupplierChangeBank coscoSupplierChangeBank : newBankList){
CoscoSupplierBank coscoSupplierBank = new CoscoSupplierBank();
BeanUtil.copyProperties(coscoSupplierChangeBank,coscoSupplierBank);
String bankId = CoscoIdUtil.getId();
coscoSupplierBank.setId(bankId);
coscoSupplierBank.setSupplierId(supplierId);
coscoSupplierBank.setCreateBy(createBy);
coscoSupplierBank.setCreateTime(CoscoDateUtils.getNowDate());
coscoSupplierBank.setUpdateBy(updateBy);
coscoSupplierBank.setUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierBank.setLastUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierBankMapper.insertCoscoSupplierBank(coscoSupplierBank);
CoscoSupplierChangeBank coscoSupplierChangeBank1 = new CoscoSupplierChangeBank();
coscoSupplierChangeBank1.setId(coscoSupplierChangeBank.getId());
coscoSupplierChangeBank1.setSupplierBankId(bankId);
coscoSupplierChangeBankMapper.updateCoscoSupplierChangeBank(coscoSupplierChangeBank1);
}
//修改审批状态
CoscoSupplierChangeApply coscoSupplierChangeApply1 = new CoscoSupplierChangeApply();
coscoSupplierChangeApply1.setId(coscoSupplierChangeApply.getId());
coscoSupplierChangeApply1.setApproveStatus(vo.getApproveStatus());
coscoSupplierChangeApply1.setUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierChangeApply1.setLastUpdateTime(CoscoDateUtils.getNowDate());
coscoSupplierChangeApplyMapper.updateCoscoSupplierChangeApply(coscoSupplierChangeApply1);
return true;
}
/**

View File

@ -57,9 +57,9 @@ public class CoscoSupplierChangeApplyServiceImpl implements ICoscoSupplierChange
CoscoSupplierChangeApply coscoSupplierChangeApply = coscoSupplierChangeApplyMapper.selectCoscoSupplierChangeApplyById(appid);
//查询当前任务的上一条任务
CoscoSupplierChangeApply coscoSupplierChangeApply1 = coscoSupplierChangeApplyMapper.selectBySupplierId(coscoSupplierChangeApply.getSupplierId());
CoscoSupplierChangeApply oldCoscoSupplierChangeApply = coscoSupplierChangeApplyMapper.selectBySupplierId(coscoSupplierChangeApply.getSupplierId());
//如果是空,说明是第一次提交变更
if(coscoSupplierChangeApply1 == null){
if(oldCoscoSupplierChangeApply == null){
//基础信息比对结果
CoscoSupplierChangeBase coscoSupplierChangeBase = new CoscoSupplierChangeBase();
coscoSupplierChangeBase.setSupplierId(coscoSupplierChangeApply.getSupplierId());
@ -110,6 +110,62 @@ public class CoscoSupplierChangeApplyServiceImpl implements ICoscoSupplierChange
diffVo.setCoscoSupplierChangeApply(coscoSupplierChangeApply);
diffVo.setSupplierChangeDiffResult(selectDiff);
diffVo.setQualificationsMap(qualificationsMap);
diffVo.setInvoiceChangeDiffVo(invoiceChangeDiffVo);
diffVo.setBankListMap(bankListMap);
}else{
//基础信息比对结果
CoscoSupplierChangeBase coscoSupplierChangeBase = new CoscoSupplierChangeBase();
coscoSupplierChangeBase.setSupplierChangeApplyIdOld(oldCoscoSupplierChangeApply.getId());
coscoSupplierChangeBase.setSupplierChangeApplyId(appid);
SupplierChangeDiffResult selectDiff = coscoSupplierChangeBaseMapper.selectDiff(coscoSupplierChangeBase);
//老基本信息
CoscoSupplierChangeBase oldCoscoSupplierBase = coscoSupplierChangeBaseMapper.selectBySupplierChangeApplyId(oldCoscoSupplierChangeApply.getId());
//新基本信息
CoscoSupplierChangeBase newCoscoSupplierBase = coscoSupplierChangeBaseMapper.selectBySupplierChangeApplyId(appid);
//原资质
CoscoSupplierChangeQualifications coscoSupplierChangeQualifications = new CoscoSupplierChangeQualifications();
coscoSupplierChangeQualifications.setSupplierId(oldCoscoSupplierBase.getId());
List<CoscoSupplierChangeQualifications> oldCoscoSupplierChangeQualificationsList =
coscoSupplierChangeQualificationsMapper.selectCoscoSupplierChangeQualificationsList(coscoSupplierChangeQualifications);
//新资质
CoscoSupplierChangeQualifications coscoSupplierChangeQualifications2 = new CoscoSupplierChangeQualifications();
coscoSupplierChangeQualifications2.setSupplierId(newCoscoSupplierBase.getId());
List<CoscoSupplierChangeQualifications> newCoscoSupplierChangeQualificationsList =
coscoSupplierChangeQualificationsMapper.selectCoscoSupplierChangeQualificationsList(coscoSupplierChangeQualifications2);
//资质对比
Map<String,Object> qualificationsMap = qualificationsDiff(oldCoscoSupplierChangeQualificationsList,newCoscoSupplierChangeQualificationsList);
//开票信息比对
CoscoSupplierChangeInvoice invoice = new CoscoSupplierChangeInvoice();
invoice.setOldSupplierId(oldCoscoSupplierBase.getId());
invoice.setNewSupplierId(newCoscoSupplierBase.getId());
InvoiceChangeDiffVo invoiceChangeDiffVo = coscoSupplierChangeInvoiceMapper.selectInvoiceDitt(invoice);
//原银行
CoscoSupplierChangeBank oldBank = new CoscoSupplierChangeBank();
oldBank.setSupplierId(oldCoscoSupplierBase.getId());
List<CoscoSupplierChangeBank> oldBankList =
coscoSupplierChangeBankMapper.selectCoscoSupplierChangeBankList(oldBank);
//新银行
CoscoSupplierChangeBank newBank = new CoscoSupplierChangeBank();
newBank.setSupplierId(newCoscoSupplierBase.getId());
List<CoscoSupplierChangeBank> newBankList =
coscoSupplierChangeBankMapper.selectCoscoSupplierChangeBankList(newBank);
//资质对比
Map<String,Object> bankListMap = bankDiff(oldBankList,newBankList);
diffVo.setCoscoSupplierChangeApply(coscoSupplierChangeApply);
diffVo.setSupplierChangeDiffResult(selectDiff);
diffVo.setQualificationsMap(qualificationsMap);

View File

@ -131,6 +131,9 @@ public class CoscoSupplierexitServiceImpl implements ICoscoSupplierexitService {
public Boolean updateCoscoSupplierexit(CoscoSupplierexit vo) {
//先验证一下主任务表数据状态
CoscoSupplierexit coscoSupplierexit = coscoSupplierexitMapper.selectCoscoSupplierexitById(vo.getId());
if(coscoSupplierexit == null){
return true;
}
if(CoscoType.APPROVE_STATUS_TG.equals(coscoSupplierexit.getApproveStatus()) ||
CoscoType.APPROVE_STATUS_BH.equals(coscoSupplierexit.getApproveStatus()) ){
return true;

View File

@ -191,8 +191,8 @@
</update>
<update id="deleteCoscoSupplierBankById" parameterType="String">
update cosco_supplier_bank set del_flag = 2
where id = #{id}
update cosco_supplier_bank set del_flag = 'deleted'
where supplier_id = #{supplierId}
</update>
<update id="deleteCoscoSupplierBankByIds" parameterType="String">

View File

@ -79,7 +79,7 @@
and social_credit_code = #{vo.socialCreditCode}
</if>
<if test="vo.range != null and vo.range != ''">
and range = #{vo.range}
and `range` = #{vo.range}
</if>
<if test="vo.regAddress != null and vo.regAddress != ''">
and reg_address = #{vo.regAddress}
@ -167,6 +167,7 @@
<select id="selectCoscoSupplierBaseList" parameterType="com.chinaunicom.zyhy.ebtp.supplier.coscosupplier.entity.CoscoSupplierBase" resultMap="CoscoSupplierBaseResult">
<include refid="selectCoscoSupplierBaseVo"/>
<where>
and del_flag = 'normal'
<if test="supplierType != null and supplierType != ''">
and supplier_type = #{supplierType}
</if>
@ -189,7 +190,7 @@
and social_credit_code = #{socialCreditCode}
</if>
<if test="range != null and range != ''">
and range = #{range}
and `range` = #{range}
</if>
<if test="regAddress != null and regAddress != ''">
and reg_address = #{regAddress}
@ -369,7 +370,7 @@
</insert>
<insert id="batchCoscoSupplierBase" parameterType="java.util.List">
insert into cosco_supplier_base
( id, supplier_type, licence_accessory, licence_date, enterprise_type, name, name_en, social_credit_code, range, reg_address, work_address, parent_company_investor, legal_person, id_card, capital, contacts_name, contacts_phone, contacts_type, contacts_email, telephone, nation, vat, taxpayer_id, currency, person_name, person_phone, person_bank, person_account, remark, access_status, blacklist_status, greylist_status, fillin_status, fillin_by, sap_code, del_flag, create_by, create_time, update_by, update_time, last_update_time)
( id, supplier_type, licence_accessory, licence_date, enterprise_type, name, name_en, social_credit_code, `range`, reg_address, work_address, parent_company_investor, legal_person, id_card, capital, contacts_name, contacts_phone, contacts_type, contacts_email, telephone, nation, vat, taxpayer_id, currency, person_name, person_phone, person_bank, person_account, remark, access_status, blacklist_status, greylist_status, fillin_status, fillin_by, sap_code, del_flag, create_by, create_time, update_by, update_time, last_update_time)
values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.id}, #{item.supplierType}, #{item.licenceAccessory}, #{item.licenceDate}, #{item.enterpriseType}, #{item.name}, #{item.nameEn}, #{item.socialCreditCode}, #{item.range}, #{item.regAddress}, #{item.workAddress}, #{item.parentCompanyInvestor}, #{item.legalPerson}, #{item.idCard}, #{item.capital}, #{item.contactsName}, #{item.contactsPhone}, #{item.contactsType}, #{item.contactsEmail}, #{item.telephone}, #{item.nation}, #{item.vat}, #{item.taxpayerId}, #{item.currency}, #{item.personName}, #{item.personPhone}, #{item.personBank}, #{item.personAccount}, #{item.remark}, #{item.accessStatus}, #{item.blacklistStatus}, #{item.greylistStatus}, #{item.fillinStatus}, #{item.fillinBy}, #{item.sapCode}, #{item.delFlag}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.lastUpdateTime})
@ -399,7 +400,7 @@
<if test="socialCreditCode != null">social_credit_code =
#{socialCreditCode},
</if>
<if test="range != null">range =
<if test="range != null">`range` =
#{range},
</if>
<if test="regAddress != null">reg_address =

View File

@ -147,6 +147,9 @@
<if test="supplierChangeApplyId != null and supplierChangeApplyId != ''">supplier_change_apply_id =
#{supplierChangeApplyId},
</if>
<if test="supplierBankId != null and supplierBankId != ''">supplier_bank_id =
#{supplierBankId},
</if>
</trim>
where id = #{id}
</update>

View File

@ -138,6 +138,10 @@
<if test="supplierChangeApplyId != null and supplierChangeApplyId != ''">supplier_change_apply_id =
#{supplierChangeApplyId},
</if>
<if test="supplierQualificationsId != null and supplierQualificationsId != ''">supplier_qualifications_id =
#{supplierQualificationsId},
</if>
</trim>
where id = #{id}
</update>

View File

@ -172,8 +172,8 @@
</update>
<update id="deleteCoscoSupplierInvoiceById" parameterType="String">
update cosco_supplier_invoice set del_flag = 2
where id = #{id}
update cosco_supplier_invoice set del_flag = 'deleted'
where supplier_id = #{supplierId}
</update>
<update id="deleteCoscoSupplierInvoiceByIds" parameterType="String">

View File

@ -172,8 +172,8 @@
</update>
<update id="deleteCoscoSupplierQualificationsById" parameterType="String">
update cosco_supplier_qualifications set del_flag = 2
where id = #{id}
update cosco_supplier_qualifications set del_flag = 'deleted'
where supplier_id = #{supplierId}
</update>
<update id="deleteCoscoSupplierQualificationsByIds" parameterType="String">