供应商变更
This commit is contained in:
parent
66855a182b
commit
cdaaee5a36
|
|
@ -25,5 +25,5 @@ public interface ISuppliersApi {
|
||||||
|
|
||||||
IPage<SuppliersOrgAllEntity> getSuppliersAuditLog(Integer pageNo, Integer pageSize, String openId);
|
IPage<SuppliersOrgAllEntity> getSuppliersAuditLog(Integer pageNo, Integer pageSize, String openId);
|
||||||
|
|
||||||
boolean nameDuplicateChecked(String suppliersName);
|
boolean nameDuplicateChecked(SuppliersApplyEntity suppliersApplyEntity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,4 +110,8 @@ public class NuBizSuppliersApply implements Serializable {
|
||||||
@Excel(name = "openId", width = 15)
|
@Excel(name = "openId", width = 15)
|
||||||
@ApiModelProperty(value = "openId")
|
@ApiModelProperty(value = "openId")
|
||||||
private java.lang.String openId;
|
private java.lang.String openId;
|
||||||
|
/**是否被拒 Y被拒绝(申请审核驳回) N除了申请被驳回以外的所有情况*/
|
||||||
|
@Excel(name = "是否被拒 Y被拒绝(申请审核驳回) N除了申请被驳回以外的所有情况", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否被拒 Y被拒绝(申请审核驳回) N除了申请被驳回以外的所有情况")
|
||||||
|
private java.lang.String izRejected;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,4 +82,8 @@ public class NuBizSuppliersOrg implements Serializable {
|
||||||
@Excel(name = "是否历史数据 Y历史 N当前数据", width = 15)
|
@Excel(name = "是否历史数据 Y历史 N当前数据", width = 15)
|
||||||
@ApiModelProperty(value = "是否历史数据 Y历史 N当前数据")
|
@ApiModelProperty(value = "是否历史数据 Y历史 N当前数据")
|
||||||
private java.lang.String izHistory;
|
private java.lang.String izHistory;
|
||||||
|
/**审核机构 */
|
||||||
|
@Excel(name = "审核机构", width = 15)
|
||||||
|
@ApiModelProperty(value = "审核机构")
|
||||||
|
private String applyOrg;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
from sys_depart d
|
from sys_depart d
|
||||||
left join nu_org_apply_info o on d.id = o.pk_id
|
left join nu_org_apply_info o on d.id = o.pk_id
|
||||||
left join nu_biz_suppliers_org s on d.org_code = s.org_code
|
left join nu_biz_suppliers_org s on d.org_code = s.org_code
|
||||||
where 1=1 and o.status = '2' and d.del_flag = '0' and d.server_url is not null and s.iz_history = 'N'
|
where 1=1 and o.status in ('2','4','5') and d.del_flag = '0' and d.server_url is not null and s.iz_history = 'N'
|
||||||
and s.open_id = #{openId}
|
and s.open_id = #{openId}
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
and d.org_code IN
|
and d.org_code IN
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,12 @@ import com.nu.modules.bizSuppliers.entity.NuBizSuppliersOrg;
|
||||||
import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersApplyMapper;
|
import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersApplyMapper;
|
||||||
import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersOrgMapper;
|
import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersOrgMapper;
|
||||||
import com.nu.modules.bizSuppliers.service.INuBizSuppliersApplyService;
|
import com.nu.modules.bizSuppliers.service.INuBizSuppliersApplyService;
|
||||||
|
import com.nu.modules.bizSuppliers.service.INuBizSuppliersOrgService;
|
||||||
import com.nu.modules.orgapplyinfo.entity.OrgAllInfo;
|
import com.nu.modules.orgapplyinfo.entity.OrgAllInfo;
|
||||||
import com.nu.modules.orgapplyinfo.entity.OrgAllInfoApiEntity;
|
import com.nu.modules.orgapplyinfo.entity.OrgAllInfoApiEntity;
|
||||||
import com.nu.modules.suppliers.ISuppliersApi;
|
import com.nu.modules.suppliers.ISuppliersApi;
|
||||||
import com.nu.utils.RabbitMQUtil;
|
import com.nu.utils.RabbitMQUtil;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -42,25 +44,36 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IEmployessAdvisioryInfoApi employessAdvisioryInfoApi;
|
private IEmployessAdvisioryInfoApi employessAdvisioryInfoApi;
|
||||||
|
@Autowired
|
||||||
|
private INuBizSuppliersOrgService suppliersOrgService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RabbitMQUtil rabbitMQUtil;
|
private RabbitMQUtil rabbitMQUtil;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuppliersApplyEntity addSuppliers(SuppliersApplyEntity suppliersApplyEntity) {
|
public SuppliersApplyEntity addSuppliers(SuppliersApplyEntity suppliersApplyEntity) {
|
||||||
QueryWrapper<NuBizSuppliersApply> queryWrapper = new QueryWrapper<>();
|
// QueryWrapper<NuBizSuppliersApply> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("open_id", suppliersApplyEntity.getOpenId());
|
// queryWrapper.eq("open_id", suppliersApplyEntity.getOpenId());
|
||||||
List<NuBizSuppliersApply> list = baseMapper.selectList(queryWrapper);
|
// List<NuBizSuppliersApply> list = baseMapper.selectList(queryWrapper);
|
||||||
if (list.size() > 0) {
|
// if (list.size() > 0) {
|
||||||
BeanUtils.copyProperties(list.get(0), suppliersApplyEntity);
|
// BeanUtils.copyProperties(list.get(0), suppliersApplyEntity);
|
||||||
return suppliersApplyEntity;
|
// return suppliersApplyEntity;
|
||||||
}
|
// }
|
||||||
NuBizSuppliersApply nuBizSuppliersApply = new NuBizSuppliersApply();
|
NuBizSuppliersApply nuBizSuppliersApply = new NuBizSuppliersApply();
|
||||||
|
if (StringUtils.isNotBlank(suppliersApplyEntity.getId())) {
|
||||||
|
//上次申请被拒绝
|
||||||
BeanUtils.copyProperties(suppliersApplyEntity, nuBizSuppliersApply);
|
BeanUtils.copyProperties(suppliersApplyEntity, nuBizSuppliersApply);
|
||||||
|
nuBizSuppliersApply.setIzRejected("N");
|
||||||
|
baseMapper.updateById(nuBizSuppliersApply);
|
||||||
|
} else {
|
||||||
|
//第一次申请
|
||||||
|
BeanUtils.copyProperties(suppliersApplyEntity, nuBizSuppliersApply);
|
||||||
|
nuBizSuppliersApply.setIzRejected("N");
|
||||||
baseMapper.insert(nuBizSuppliersApply);
|
baseMapper.insert(nuBizSuppliersApply);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//修改此用户信息咨询表iz_jg标识为Y(是机构)
|
//修改此用户信息咨询表iz_gys(是否供应商)置为Y
|
||||||
EmployeesAdvisoryInfoEntity edEntity = new EmployeesAdvisoryInfoEntity();
|
EmployeesAdvisoryInfoEntity edEntity = new EmployeesAdvisoryInfoEntity();
|
||||||
edEntity.setOpenId(suppliersApplyEntity.getOpenId());
|
edEntity.setOpenId(suppliersApplyEntity.getOpenId());
|
||||||
edEntity.setIzGys("Y");
|
edEntity.setIzGys("Y");
|
||||||
|
|
@ -93,7 +106,7 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
||||||
if (listOrg.size() > 0) {
|
if (listOrg.size() > 0) {
|
||||||
BeanUtils.copyProperties(listOrg.get(0), suppliersOrgEntity);
|
BeanUtils.copyProperties(listOrg.get(0), suppliersOrgEntity);
|
||||||
return suppliersOrgEntity;
|
return suppliersOrgEntity;
|
||||||
}else{
|
} else {
|
||||||
//修改原来的数据都改为历史数据
|
//修改原来的数据都改为历史数据
|
||||||
UpdateWrapper<NuBizSuppliersOrg> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<NuBizSuppliersOrg> updateWrapper = new UpdateWrapper<>();
|
||||||
updateWrapper.eq("open_id", suppliersOrgEntity.getOpenId());
|
updateWrapper.eq("open_id", suppliersOrgEntity.getOpenId());
|
||||||
|
|
@ -111,9 +124,9 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
||||||
}
|
}
|
||||||
nuBizSuppliersOrg.setStatus("1");
|
nuBizSuppliersOrg.setStatus("1");
|
||||||
nuBizSuppliersOrg.setIzHistory("N");
|
nuBizSuppliersOrg.setIzHistory("N");
|
||||||
|
nuBizSuppliersOrg.setApplyOrg(suppliersOrgEntity.getOrgCode());//审核机构
|
||||||
nuBizSuppliersOrgMapper.insert(nuBizSuppliersOrg);
|
nuBizSuppliersOrgMapper.insert(nuBizSuppliersOrg);
|
||||||
|
|
||||||
//todo 向对应业务机构添加供应商审核数据
|
|
||||||
NuBizSuppliersApply nuBizSuppliersApply = list.get(0);
|
NuBizSuppliersApply nuBizSuppliersApply = list.get(0);
|
||||||
SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto();
|
SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto();
|
||||||
suppliersInfoMQDto.setSuppliersName(nuBizSuppliersApply.getSuppliersName());
|
suppliersInfoMQDto.setSuppliersName(nuBizSuppliersApply.getSuppliersName());
|
||||||
|
|
@ -144,38 +157,71 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuppliersApplyEntity editSuppliers(SuppliersApplyEntity suppliersApplyEntity) {
|
public SuppliersApplyEntity editSuppliers(SuppliersApplyEntity suppliersApplyEntity) {
|
||||||
NuBizSuppliersApply nuBizSuppliersApply = new NuBizSuppliersApply();
|
//先把管理平台中间表变更为历史状态
|
||||||
BeanUtils.copyProperties(suppliersApplyEntity, nuBizSuppliersApply);
|
UpdateWrapper<NuBizSuppliersOrg> uw = new UpdateWrapper<>();
|
||||||
baseMapper.updateById(nuBizSuppliersApply);
|
uw.eq("suppliers_id",suppliersApplyEntity.getId());
|
||||||
|
NuBizSuppliersOrg soDto = new NuBizSuppliersOrg();
|
||||||
|
soDto.setIzHistory("Y");
|
||||||
|
suppliersOrgService.update(soDto,uw);
|
||||||
|
|
||||||
|
//插入新的数据
|
||||||
|
NuBizSuppliersOrg addDto = new NuBizSuppliersOrg();
|
||||||
|
addDto.setOpenId(suppliersApplyEntity.getOpenId());
|
||||||
|
addDto.setSuppliersId(suppliersApplyEntity.getId());
|
||||||
|
addDto.setOrgCode(suppliersApplyEntity.getApplyOrg());
|
||||||
|
addDto.setStatus("4");//变更申请
|
||||||
|
addDto.setApplyOrg(suppliersApplyEntity.getApplyOrg());
|
||||||
|
addDto.setIzHistory("N");
|
||||||
|
|
||||||
|
suppliersOrgService.save(addDto);
|
||||||
|
|
||||||
QueryWrapper<NuBizSuppliersOrg> queryWrapper = new QueryWrapper<>();
|
//通知业务平台去审核
|
||||||
queryWrapper.eq("status", "2");
|
|
||||||
queryWrapper.eq("iz_history", "N");
|
|
||||||
List<NuBizSuppliersOrg> list = nuBizSuppliersOrgMapper.selectList(queryWrapper);
|
|
||||||
for(NuBizSuppliersOrg nuBizSuppliersOrg:list){
|
|
||||||
//todo 修改对应机构的供应商数据
|
|
||||||
SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto();
|
SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto();
|
||||||
suppliersInfoMQDto.setSuppliersName(nuBizSuppliersApply.getSuppliersName());
|
suppliersInfoMQDto.setSuppliersName(suppliersApplyEntity.getSuppliersName());
|
||||||
suppliersInfoMQDto.setSuppliersNature(nuBizSuppliersApply.getSuppliersNature());
|
suppliersInfoMQDto.setSuppliersNature(suppliersApplyEntity.getSuppliersNature());
|
||||||
suppliersInfoMQDto.setSuppliersAddress(nuBizSuppliersApply.getSuppliersAddress());
|
suppliersInfoMQDto.setSuppliersAddress(suppliersApplyEntity.getSuppliersAddress());
|
||||||
suppliersInfoMQDto.setPersonInCharge(nuBizSuppliersApply.getPersonInCharge());
|
suppliersInfoMQDto.setPersonInCharge(suppliersApplyEntity.getPersonInCharge());
|
||||||
suppliersInfoMQDto.setContactNumber(nuBizSuppliersApply.getContactNumber());
|
suppliersInfoMQDto.setContactNumber(suppliersApplyEntity.getContactNumber());
|
||||||
suppliersInfoMQDto.setSupplyState(nuBizSuppliersApply.getSupplyState());
|
suppliersInfoMQDto.setSupplyState(suppliersApplyEntity.getSupplyState());
|
||||||
suppliersInfoMQDto.setOpeningBank(nuBizSuppliersApply.getOpeningBank());
|
suppliersInfoMQDto.setOpeningBank(suppliersApplyEntity.getOpeningBank());
|
||||||
suppliersInfoMQDto.setOpeningBankNo(nuBizSuppliersApply.getOpeningBankNo());
|
suppliersInfoMQDto.setOpeningBankNo(suppliersApplyEntity.getOpeningBankNo());
|
||||||
suppliersInfoMQDto.setImgPath(nuBizSuppliersApply.getImgPath());
|
suppliersInfoMQDto.setImgPath(suppliersApplyEntity.getImgPath());
|
||||||
// suppliersInfoMQDto.setApplyStatus("1");
|
suppliersInfoMQDto.setSysOrgCode(suppliersApplyEntity.getApplyOrg());
|
||||||
suppliersInfoMQDto.setSysOrgCode(nuBizSuppliersOrg.getOrgCode());
|
suppliersInfoMQDto.setSuppliersId(suppliersApplyEntity.getId());
|
||||||
suppliersInfoMQDto.setSuppliersId(nuBizSuppliersApply.getId());
|
suppliersInfoMQDto.setApplyId(addDto.getSuppliersId());
|
||||||
rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", nuBizSuppliersOrg.getOrgCode() + ".suppliers.editSuppliersApply", suppliersInfoMQDto);
|
//TODO 删掉解开
|
||||||
}
|
rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", "101.suppliers.editSuppliersApply", suppliersInfoMQDto);
|
||||||
|
// rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", suppliersApplyEntity.getApplyOrg() + ".suppliers.editSuppliersApply", suppliersInfoMQDto);
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// baseMapper.updateById(nuBizSuppliersApply);
|
||||||
|
|
||||||
|
|
||||||
|
// QueryWrapper<NuBizSuppliersOrg> queryWrapper = new QueryWrapper<>();
|
||||||
BeanUtils.copyProperties(nuBizSuppliersApply, suppliersApplyEntity);
|
// queryWrapper.eq("status", "2");
|
||||||
return suppliersApplyEntity;
|
// queryWrapper.eq("iz_history", "N");
|
||||||
|
// List<NuBizSuppliersOrg> list = nuBizSuppliersOrgMapper.selectList(queryWrapper);
|
||||||
|
// for (NuBizSuppliersOrg nuBizSuppliersOrg : list) {
|
||||||
|
// //todo 修改对应机构的供应商数据
|
||||||
|
// SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto();
|
||||||
|
// suppliersInfoMQDto.setSuppliersName(nuBizSuppliersApply.getSuppliersName());
|
||||||
|
// suppliersInfoMQDto.setSuppliersNature(nuBizSuppliersApply.getSuppliersNature());
|
||||||
|
// suppliersInfoMQDto.setSuppliersAddress(nuBizSuppliersApply.getSuppliersAddress());
|
||||||
|
// suppliersInfoMQDto.setPersonInCharge(nuBizSuppliersApply.getPersonInCharge());
|
||||||
|
// suppliersInfoMQDto.setContactNumber(nuBizSuppliersApply.getContactNumber());
|
||||||
|
// suppliersInfoMQDto.setSupplyState(nuBizSuppliersApply.getSupplyState());
|
||||||
|
// suppliersInfoMQDto.setOpeningBank(nuBizSuppliersApply.getOpeningBank());
|
||||||
|
// suppliersInfoMQDto.setOpeningBankNo(nuBizSuppliersApply.getOpeningBankNo());
|
||||||
|
// suppliersInfoMQDto.setImgPath(nuBizSuppliersApply.getImgPath());
|
||||||
|
//// suppliersInfoMQDto.setApplyStatus("1");
|
||||||
|
// suppliersInfoMQDto.setSysOrgCode(nuBizSuppliersOrg.getOrgCode());
|
||||||
|
// suppliersInfoMQDto.setSuppliersId(nuBizSuppliersApply.getId());
|
||||||
|
// rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", nuBizSuppliersOrg.getOrgCode() + ".suppliers.editSuppliersApply", suppliersInfoMQDto);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// BeanUtils.copyProperties(nuBizSuppliersApply, suppliersApplyEntity);
|
||||||
|
// return suppliersApplyEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -199,13 +245,18 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean nameDuplicateChecked(String suppliersName) {
|
public boolean nameDuplicateChecked(SuppliersApplyEntity suppliersApplyEntity) {
|
||||||
|
//不考虑审核中的 如果要考虑审核中的 变更审核数据在业务平台 需要遍历业务平台去验证
|
||||||
QueryWrapper<NuBizSuppliersApply> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<NuBizSuppliersApply> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("suppliers_name",suppliersName);
|
if (StringUtils.isNotBlank(suppliersApplyEntity.getId())) {
|
||||||
|
queryWrapper.ne("id", suppliersApplyEntity.getId());
|
||||||
|
}
|
||||||
|
queryWrapper.eq("suppliers_name", suppliersApplyEntity.getSuppliersName());
|
||||||
|
queryWrapper.eq("iz_rejected", "N");//不包含已拒绝供应商
|
||||||
List<NuBizSuppliersApply> nuBizSuppliersApplies = baseMapper.selectList(queryWrapper);
|
List<NuBizSuppliersApply> nuBizSuppliersApplies = baseMapper.selectList(queryWrapper);
|
||||||
if(CollectionUtils.isEmpty(nuBizSuppliersApplies)){
|
if (CollectionUtils.isEmpty(nuBizSuppliersApplies)) {
|
||||||
return false;
|
return false;
|
||||||
}else{
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,16 @@ package com.nu.mq.suppliers.listener;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.nu.dto.SuppliersInfoMQDto;
|
import com.nu.dto.SuppliersInfoMQDto;
|
||||||
import com.nu.dto.WorkOrderMQDto;
|
import com.nu.dto.WorkOrderMQDto;
|
||||||
import com.nu.entity.NuWxNoticeEntity;
|
import com.nu.entity.NuWxNoticeEntity;
|
||||||
import com.nu.entity.WxNoticeEntity;
|
import com.nu.entity.WxNoticeEntity;
|
||||||
import com.nu.enums.WxClientType;
|
import com.nu.enums.WxClientType;
|
||||||
|
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersApply;
|
||||||
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersOrg;
|
import com.nu.modules.bizSuppliers.entity.NuBizSuppliersOrg;
|
||||||
|
import com.nu.modules.bizSuppliers.service.INuBizSuppliersApplyService;
|
||||||
import com.nu.modules.bizSuppliers.service.INuBizSuppliersOrgService;
|
import com.nu.modules.bizSuppliers.service.INuBizSuppliersOrgService;
|
||||||
import com.nu.modules.wxnotice.IWxNoticeApi;
|
import com.nu.modules.wxnotice.IWxNoticeApi;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -30,7 +33,8 @@ public class SuppliersMQListener {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private INuBizSuppliersOrgService nuBizSuppliersOrgService;
|
private INuBizSuppliersOrgService nuBizSuppliersOrgService;
|
||||||
|
@Autowired
|
||||||
|
private INuBizSuppliersApplyService applyService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IWxNoticeApi wxNoticeApi;
|
private IWxNoticeApi wxNoticeApi;
|
||||||
|
|
||||||
|
|
@ -59,6 +63,16 @@ public class SuppliersMQListener {
|
||||||
|
|
||||||
nuBizSuppliersOrg = nuBizSuppliersOrgService.getById(nuBizSuppliersOrg.getId());
|
nuBizSuppliersOrg = nuBizSuppliersOrgService.getById(nuBizSuppliersOrg.getId());
|
||||||
|
|
||||||
|
NuBizSuppliersApply apply = new NuBizSuppliersApply();
|
||||||
|
apply.setId(suppliersInfoMQDto.getSuppliersId());
|
||||||
|
if (StringUtils.equals("2", nuBizSuppliersOrg.getStatus())) {
|
||||||
|
apply.setIzRejected("N");
|
||||||
|
} else {
|
||||||
|
apply.setIzRejected("Y");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(apply.getIzRejected())) {
|
||||||
|
applyService.updateById(apply);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
String content1 = "";
|
String content1 = "";
|
||||||
|
|
@ -67,10 +81,10 @@ public class SuppliersMQListener {
|
||||||
// queryWrapper.eq("org_code", nuBizSuppliersOrg.getOrgCode());
|
// queryWrapper.eq("org_code", nuBizSuppliersOrg.getOrgCode());
|
||||||
// SysDepart dto = sysDepartService.getOne(queryWrapper);
|
// SysDepart dto = sysDepartService.getOne(queryWrapper);
|
||||||
//审核通过
|
//审核通过
|
||||||
if(StringUtils.equals("2",nuBizSuppliersOrg.getStatus())){
|
if (StringUtils.equals("2", nuBizSuppliersOrg.getStatus())) {
|
||||||
content1 = "您好,您提交的入驻信息已通过";
|
content1 = "您好,您提交的入驻信息已通过";
|
||||||
content2 = "审核通过";
|
content2 = "审核通过";
|
||||||
}else if(StringUtils.equals("3",nuBizSuppliersOrg.getStatus())){
|
} else if (StringUtils.equals("3", nuBizSuppliersOrg.getStatus())) {
|
||||||
content1 = "您好,您提交的入驻信息已驳回";
|
content1 = "您好,您提交的入驻信息已驳回";
|
||||||
content2 = "审核驳回";
|
content2 = "审核驳回";
|
||||||
}
|
}
|
||||||
|
|
@ -96,4 +110,81 @@ public class SuppliersMQListener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更审核结果
|
||||||
|
*/
|
||||||
|
@RabbitListener(
|
||||||
|
bindings = @QueueBinding(
|
||||||
|
value = @Queue(name = "nu.suppliers.updateAuditResult"),
|
||||||
|
exchange = @Exchange(name = "nu.suppliers.updateAuditResult", type = ExchangeTypes.DIRECT),
|
||||||
|
key = "nu.suppliers.updateAuditResult"
|
||||||
|
),
|
||||||
|
errorHandler = "suppliersMQExceptionHandler"
|
||||||
|
)
|
||||||
|
public void updateAuditResult(SuppliersInfoMQDto suppliersInfoMQDto) {
|
||||||
|
try{
|
||||||
|
log.info("变更审核结果: {}", suppliersInfoMQDto);
|
||||||
|
|
||||||
|
UpdateWrapper<NuBizSuppliersOrg> orgUW = new UpdateWrapper<>();
|
||||||
|
orgUW.eq("suppliers_id",suppliersInfoMQDto.getSuppliersId());
|
||||||
|
orgUW.eq("iz_history","N");
|
||||||
|
NuBizSuppliersOrg nuBizSuppliersOrg = new NuBizSuppliersOrg();
|
||||||
|
if (StringUtils.equals("modifyPass", suppliersInfoMQDto.getStatus())) {
|
||||||
|
nuBizSuppliersOrg.setStatus("2");
|
||||||
|
} else {
|
||||||
|
nuBizSuppliersOrg.setStatus("4");
|
||||||
|
}
|
||||||
|
nuBizSuppliersOrg.setAuditContent(suppliersInfoMQDto.getApplyContent());
|
||||||
|
nuBizSuppliersOrgService.update(nuBizSuppliersOrg,orgUW);
|
||||||
|
|
||||||
|
if (StringUtils.equals("modifyPass", suppliersInfoMQDto.getStatus())) {
|
||||||
|
NuBizSuppliersApply apply = new NuBizSuppliersApply();
|
||||||
|
apply.setId(suppliersInfoMQDto.getSuppliersId());
|
||||||
|
apply.setSuppliersName(suppliersInfoMQDto.getSuppliersName());//供应商名称
|
||||||
|
apply.setSuppliersNature(suppliersInfoMQDto.getSuppliersNature());//供应商性质
|
||||||
|
apply.setSuppliersAddress(suppliersInfoMQDto.getSuppliersAddress());//供应商地址
|
||||||
|
apply.setPersonInCharge(suppliersInfoMQDto.getPersonInCharge());//负责人
|
||||||
|
apply.setContactNumber(suppliersInfoMQDto.getContactNumber());//联系电话
|
||||||
|
apply.setOpeningBank(suppliersInfoMQDto.getOpeningBank());//开户行
|
||||||
|
apply.setOpeningBankNo(suppliersInfoMQDto.getOpeningBankNo());//开户行账号
|
||||||
|
apply.setImgPath(suppliersInfoMQDto.getImgPath());//资质照片
|
||||||
|
applyService.updateById(apply);
|
||||||
|
}
|
||||||
|
|
||||||
|
String content1 = "";
|
||||||
|
String content2 = "";
|
||||||
|
// QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>();
|
||||||
|
// queryWrapper.eq("org_code", nuBizSuppliersOrg.getOrgCode());
|
||||||
|
// SysDepart dto = sysDepartService.getOne(queryWrapper);
|
||||||
|
//审核通过
|
||||||
|
if (StringUtils.equals("modifyPass", suppliersInfoMQDto.getStatus())) {
|
||||||
|
content1 = "您好,您提交的信息变更已通过";
|
||||||
|
content2 = "信息变更审核通过";
|
||||||
|
} else if (StringUtils.equals("modifyFail", suppliersInfoMQDto.getStatus())) {
|
||||||
|
content1 = "您好,您提交的信息变更未通过";
|
||||||
|
content2 = "信息变更审核未通过";
|
||||||
|
}
|
||||||
|
NuWxNoticeEntity nuWxNotice = new NuWxNoticeEntity();
|
||||||
|
nuWxNotice.setOpenId(nuBizSuppliersOrg.getOpenId());
|
||||||
|
nuWxNotice.setIzRead("N");
|
||||||
|
nuWxNotice.setOrgCode(nuBizSuppliersOrg.getOrgCode());
|
||||||
|
nuWxNotice.setTitle("供应商信息变更审核");
|
||||||
|
nuWxNotice.setContent(content1);
|
||||||
|
nuWxNotice.setType("suppliers_ausit_status");
|
||||||
|
Map<String, Object> extend = Maps.newHashMap();
|
||||||
|
extend.put("orgCode", nuBizSuppliersOrg.getOrgCode());
|
||||||
|
extend.put("suppliersId", nuBizSuppliersOrg.getSuppliersId());
|
||||||
|
nuWxNotice.setExtend(JSONObject.toJSONString(extend));
|
||||||
|
nuWxNotice.setClientType(WxClientType.SUPPLIERS.getCode());
|
||||||
|
wxNoticeApi.addNotice(nuWxNotice);
|
||||||
|
WxNoticeEntity wxNotice = new WxNoticeEntity();
|
||||||
|
wxNotice.setPageRoute("pages/supplierindex/index");
|
||||||
|
wxNotice.setThing2("供应商信息变更审核");
|
||||||
|
wxNotice.setPhrase1(content2);
|
||||||
|
wxNotice.setLogMainInfo("供应商信息变更审核");
|
||||||
|
wxNoticeApi.sendWechartMessage_SHENHE(wxNotice, nuWxNotice);
|
||||||
|
}catch(Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public class SuppliersApi {
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/addSuppliers")
|
@PostMapping(value = "/addSuppliers")
|
||||||
public Result<Object> addSuppliers(@RequestBody SuppliersApplyEntity suppliersApplyEntity) {
|
public Result<Object> addSuppliers(@RequestBody SuppliersApplyEntity suppliersApplyEntity) {
|
||||||
if(!suppliersApi.nameDuplicateChecked(suppliersApplyEntity.getSuppliersName())){
|
if(suppliersApi.nameDuplicateChecked(suppliersApplyEntity)){
|
||||||
return Result.error("供应商名称重复");
|
return Result.error("供应商名称重复");
|
||||||
}
|
}
|
||||||
SuppliersApplyEntity suppliersApplyEntity1 = suppliersApi.addSuppliers(suppliersApplyEntity);
|
SuppliersApplyEntity suppliersApplyEntity1 = suppliersApi.addSuppliers(suppliersApplyEntity);
|
||||||
|
|
@ -46,7 +46,7 @@ public class SuppliersApi {
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/editSuppliers")
|
@PostMapping(value = "/editSuppliers")
|
||||||
public Result<Object> editSuppliers(@RequestBody SuppliersApplyEntity suppliersApplyEntity) {
|
public Result<Object> editSuppliers(@RequestBody SuppliersApplyEntity suppliersApplyEntity) {
|
||||||
if(!suppliersApi.nameDuplicateChecked(suppliersApplyEntity.getSuppliersName())){
|
if(suppliersApi.nameDuplicateChecked(suppliersApplyEntity)){
|
||||||
return Result.error("供应商名称重复");
|
return Result.error("供应商名称重复");
|
||||||
}
|
}
|
||||||
SuppliersApplyEntity suppliersApplyEntity1 = suppliersApi.editSuppliers(suppliersApplyEntity);
|
SuppliersApplyEntity suppliersApplyEntity1 = suppliersApi.editSuppliers(suppliersApplyEntity);
|
||||||
|
|
|
||||||
|
|
@ -70,4 +70,6 @@ public class SuppliersInfoMQDto implements Serializable {
|
||||||
private String applyId;
|
private String applyId;
|
||||||
/**供应商id*/
|
/**供应商id*/
|
||||||
private String suppliersId;
|
private String suppliersId;
|
||||||
|
/**变更审核结果*/
|
||||||
|
private java.lang.String status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,4 +65,6 @@ public class SuppliersApplyEntity implements Serializable {
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
/**openId*/
|
/**openId*/
|
||||||
private String openId;
|
private String openId;
|
||||||
|
|
||||||
|
private String applyOrg;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,65 +16,44 @@ import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 供应商-机构中间表
|
* @Description: 供应商-机构中间表 nu_biz_suppliers_org
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2025-12-22
|
* @Date: 2025-12-22
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("nu_biz_suppliers_org")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="nu_biz_suppliers_org对象", description="供应商-机构中间表")
|
|
||||||
public class SuppliersOrgEntity implements Serializable {
|
public class SuppliersOrgEntity implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**id*/
|
/**id*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@ApiModelProperty(value = "id")
|
|
||||||
private String id;
|
private String id;
|
||||||
/**微信id*/
|
/**微信id*/
|
||||||
@Excel(name = "微信id", width = 15)
|
|
||||||
@ApiModelProperty(value = "微信id")
|
|
||||||
private String openId;
|
private String openId;
|
||||||
/**供应商nu_biz_suppliers_apply.id*/
|
/**供应商nu_biz_suppliers_apply.id*/
|
||||||
@Excel(name = "供应商nu_biz_suppliers_apply.id", width = 15)
|
|
||||||
@ApiModelProperty(value = "供应商nu_biz_suppliers_apply.id")
|
|
||||||
private String suppliersId;
|
private String suppliersId;
|
||||||
/**机构编码*/
|
/**机构编码*/
|
||||||
@Excel(name = "机构编码", width = 15)
|
|
||||||
@ApiModelProperty(value = "机构编码")
|
|
||||||
private String orgCode;
|
private String orgCode;
|
||||||
/**创建人*/
|
/**创建人*/
|
||||||
@ApiModelProperty(value = "创建人")
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
/**创建日期*/
|
/**创建日期*/
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value = "创建日期")
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
/**更新人*/
|
/**更新人*/
|
||||||
@ApiModelProperty(value = "更新人")
|
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
/**更新日期*/
|
/**更新日期*/
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
@ApiModelProperty(value = "更新日期")
|
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
/**是否在线 Y在线 N不在线*/
|
/**是否在线 Y在线 N不在线*/
|
||||||
@Excel(name = "是否在线 Y在线 N不在线", width = 15)
|
|
||||||
@ApiModelProperty(value = "是否在线 Y在线 N不在线")
|
|
||||||
private String izOnline;
|
private String izOnline;
|
||||||
/**申请状态 1申请中 2通过 3驳回*/
|
/**申请状态 1申请中 2通过 3驳回*/
|
||||||
@Excel(name = "申请状态 1申请中 2通过 3驳回", width = 15)
|
|
||||||
@ApiModelProperty(value = "申请状态 1申请中 2通过 3驳回")
|
|
||||||
private String status;
|
private String status;
|
||||||
/**审核备注*/
|
/**审核备注*/
|
||||||
@Excel(name = "审核备注", width = 15)
|
|
||||||
@ApiModelProperty(value = "审核备注")
|
|
||||||
private String auditContent;
|
private String auditContent;
|
||||||
/**是否历史数据 Y历史 N当前数据*/
|
/**是否历史数据 Y历史 N当前数据*/
|
||||||
@Excel(name = "是否历史数据 Y历史 N当前数据", width = 15)
|
|
||||||
@ApiModelProperty(value = "是否历史数据 Y历史 N当前数据")
|
|
||||||
private String izHistory;
|
private String izHistory;
|
||||||
|
/**审核机构 */
|
||||||
|
private String applyOrg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue