供应商审核整体流程变更
This commit is contained in:
parent
baf92d1b81
commit
d8fb32525b
|
|
@ -21,7 +21,7 @@ public interface ISuppliersApi {
|
|||
|
||||
SuppliersApplyEntity editSuppliers(SuppliersApplyEntity suppliersApplyEntity);
|
||||
|
||||
SuppliersApplyEntity getSupInfoByOpenId(String openId);
|
||||
SuppliersApplyEntity getSupInfoByOpenId(String openId, String orgCode);
|
||||
|
||||
IPage<SuppliersOrgAllEntity> getSuppliersAuditLog(Integer pageNo, Integer pageSize, String openId);
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
from sys_depart d
|
||||
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
|
||||
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'
|
||||
where 1=1 and o.status = '2' and d.del_flag = '0' and d.server_url is not null and s.iz_history = 'N'
|
||||
and s.open_id = #{openId}
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
and d.org_code IN
|
||||
|
|
|
|||
|
|
@ -159,10 +159,11 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
|||
public SuppliersApplyEntity editSuppliers(SuppliersApplyEntity suppliersApplyEntity) {
|
||||
//先把管理平台中间表变更为历史状态
|
||||
UpdateWrapper<NuBizSuppliersOrg> uw = new UpdateWrapper<>();
|
||||
uw.eq("suppliers_id",suppliersApplyEntity.getId());
|
||||
uw.eq("suppliers_id", suppliersApplyEntity.getId());
|
||||
uw.eq("org_code", suppliersApplyEntity.getOrgCode());
|
||||
NuBizSuppliersOrg soDto = new NuBizSuppliersOrg();
|
||||
soDto.setIzHistory("Y");
|
||||
suppliersOrgService.update(soDto,uw);
|
||||
suppliersOrgService.update(soDto, uw);
|
||||
|
||||
//插入新的数据
|
||||
NuBizSuppliersOrg addDto = new NuBizSuppliersOrg();
|
||||
|
|
@ -189,8 +190,7 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
|||
suppliersInfoMQDto.setSysOrgCode(suppliersApplyEntity.getApplyOrg());
|
||||
suppliersInfoMQDto.setSuppliersId(suppliersApplyEntity.getId());
|
||||
suppliersInfoMQDto.setApplyId(addDto.getSuppliersId());
|
||||
//TODO 删掉解开
|
||||
rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", "101.suppliers.editSuppliersApply", suppliersInfoMQDto);
|
||||
rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", suppliersApplyEntity.getApplyOrg() + ".suppliers.editSuppliersApply", suppliersInfoMQDto);
|
||||
// rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", suppliersApplyEntity.getApplyOrg() + ".suppliers.editSuppliersApply", suppliersInfoMQDto);
|
||||
return null;
|
||||
|
||||
|
|
@ -225,7 +225,7 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
|||
}
|
||||
|
||||
@Override
|
||||
public SuppliersApplyEntity getSupInfoByOpenId(String openId) {
|
||||
public SuppliersApplyEntity getSupInfoByOpenId(String openId, String orgCode) {
|
||||
QueryWrapper<NuBizSuppliersApply> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("open_id", openId);
|
||||
List<NuBizSuppliersApply> list = baseMapper.selectList(queryWrapper);
|
||||
|
|
@ -233,11 +233,23 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl<NuBizSuppliersAp
|
|||
SuppliersApplyEntity suppliersApplyEntity = new SuppliersApplyEntity();
|
||||
BeanUtils.copyProperties(list.get(0), suppliersApplyEntity);
|
||||
QueryWrapper<NuBizSuppliersOrg> qw = new QueryWrapper<>();
|
||||
qw.eq("suppliers_id",list.get(0).getId());
|
||||
qw.eq("iz_history","N");
|
||||
NuBizSuppliersOrg so = suppliersOrgService.getOne(qw);
|
||||
suppliersApplyEntity.setSuppliersStatus(so.getStatus());
|
||||
suppliersApplyEntity.setAuditContent(so.getAuditContent());
|
||||
qw.eq("suppliers_id", list.get(0).getId());
|
||||
qw.eq("iz_history", "N");
|
||||
// qw.eq("org_code", orgCode);
|
||||
List<NuBizSuppliersOrg> soList = suppliersOrgService.list(qw);
|
||||
if (!CollectionUtils.isEmpty(soList)) {
|
||||
for (int i = 0; i < soList.size(); i++) {
|
||||
NuBizSuppliersOrg so = soList.get(i);
|
||||
if (so.getOrgCode().equals(orgCode)) {
|
||||
suppliersApplyEntity.setSuppliersStatus(so.getStatus());
|
||||
suppliersApplyEntity.setAuditContent(so.getAuditContent());
|
||||
suppliersApplyEntity.setOrgCode(orgCode);
|
||||
}
|
||||
if("4".equals(so.getStatus())){
|
||||
suppliersApplyEntity.setIzModify(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return suppliersApplyEntity;
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class WxNoticeServiceImpl extends ServiceImpl<WxNoticeMapper, WxNotice> i
|
|||
QueryWrapper<WxNotice> qw = new QueryWrapper<>();
|
||||
qw.eq("open_id", openId);
|
||||
qw.eq("client_type", clientType);//哪个端(机构?员工?家属?)
|
||||
qw.orderByDesc("iz_read");//未读在前
|
||||
qw.orderByAsc("CASE WHEN iz_read = 'N' THEN 1 WHEN iz_read = 'Y' THEN 2 ELSE 3 END");//未读在前
|
||||
qw.orderByDesc("create_time");//按照时间倒序
|
||||
List<WxNotice> wxNotices = baseMapper.selectList(page, qw);
|
||||
List<NuWxNoticeEntity> result = BeanUtil.copyToList(wxNotices, NuWxNoticeEntity.class);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ 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.wxnotice.IWxNoticeApi;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
|
|
@ -25,6 +26,7 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
|
|
@ -37,6 +39,8 @@ public class SuppliersMQListener {
|
|||
private INuBizSuppliersApplyService applyService;
|
||||
@Autowired
|
||||
private IWxNoticeApi wxNoticeApi;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
/**
|
||||
* 工单回执
|
||||
|
|
@ -122,20 +126,20 @@ public class SuppliersMQListener {
|
|||
errorHandler = "suppliersMQExceptionHandler"
|
||||
)
|
||||
public void updateAuditResult(SuppliersInfoMQDto suppliersInfoMQDto) {
|
||||
try{
|
||||
try {
|
||||
log.info("变更审核结果: {}", suppliersInfoMQDto);
|
||||
|
||||
UpdateWrapper<NuBizSuppliersOrg> orgUW = new UpdateWrapper<>();
|
||||
orgUW.eq("suppliers_id",suppliersInfoMQDto.getSuppliersId());
|
||||
orgUW.eq("iz_history","N");
|
||||
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.setStatus("5");
|
||||
}
|
||||
nuBizSuppliersOrg.setAuditContent(suppliersInfoMQDto.getApplyContent());
|
||||
nuBizSuppliersOrgService.update(nuBizSuppliersOrg,orgUW);
|
||||
nuBizSuppliersOrgService.update(nuBizSuppliersOrg, orgUW);
|
||||
|
||||
if (StringUtils.equals("modifyPass", suppliersInfoMQDto.getStatus())) {
|
||||
NuBizSuppliersApply apply = new NuBizSuppliersApply();
|
||||
|
|
@ -151,6 +155,20 @@ public class SuppliersMQListener {
|
|||
applyService.updateById(apply);
|
||||
}
|
||||
|
||||
if (StringUtils.equals("modifyPass", suppliersInfoMQDto.getStatus())) {
|
||||
//给此供应商已入住机构发通知修改信息
|
||||
QueryWrapper<NuBizSuppliersOrg> qw = new QueryWrapper<>();
|
||||
qw.eq("suppliers_id",suppliersInfoMQDto.getSuppliersId());
|
||||
qw.groupBy("org_code");
|
||||
qw.select("org_code");
|
||||
List<NuBizSuppliersOrg> orgList = nuBizSuppliersOrgService.list(qw);
|
||||
orgList.stream().forEach(item -> {
|
||||
if(!suppliersInfoMQDto.getSysOrgCode().equals(item.getOrgCode())){
|
||||
rabbitMQUtil.sendToExchange("nu.suppliers.upSuppliersInfo", item.getOrgCode() + ".suppliers.upSuppliersInfo", suppliersInfoMQDto);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String content1 = "";
|
||||
String content2 = "";
|
||||
// QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>();
|
||||
|
|
@ -183,7 +201,7 @@ public class SuppliersMQListener {
|
|||
wxNotice.setPhrase1(content2);
|
||||
wxNotice.setLogMainInfo("供应商信息变更审核");
|
||||
wxNoticeApi.sendWechartMessage_SHENHE(wxNotice, nuWxNotice);
|
||||
}catch(Exception e){
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,12 +26,13 @@ public class SuppliersApi {
|
|||
|
||||
/**
|
||||
* 入驻供应商
|
||||
*
|
||||
* @param suppliersApplyEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/addSuppliers")
|
||||
public Result<Object> addSuppliers(@RequestBody SuppliersApplyEntity suppliersApplyEntity) {
|
||||
if(suppliersApi.nameDuplicateChecked(suppliersApplyEntity)){
|
||||
if (suppliersApi.nameDuplicateChecked(suppliersApplyEntity)) {
|
||||
return Result.error("供应商名称重复");
|
||||
}
|
||||
SuppliersApplyEntity suppliersApplyEntity1 = suppliersApi.addSuppliers(suppliersApplyEntity);
|
||||
|
|
@ -41,12 +42,13 @@ public class SuppliersApi {
|
|||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*
|
||||
* @param suppliersApplyEntity
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/editSuppliers")
|
||||
public Result<Object> editSuppliers(@RequestBody SuppliersApplyEntity suppliersApplyEntity) {
|
||||
if(suppliersApi.nameDuplicateChecked(suppliersApplyEntity)){
|
||||
if (suppliersApi.nameDuplicateChecked(suppliersApplyEntity)) {
|
||||
return Result.error("供应商名称重复");
|
||||
}
|
||||
SuppliersApplyEntity suppliersApplyEntity1 = suppliersApi.editSuppliers(suppliersApplyEntity);
|
||||
|
|
@ -55,6 +57,7 @@ public class SuppliersApi {
|
|||
|
||||
/**
|
||||
* 获取供应商已经入驻机构的信息
|
||||
*
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param orgCode
|
||||
|
|
@ -69,7 +72,7 @@ public class SuppliersApi {
|
|||
@RequestParam(value = "orgCode", defaultValue = "", required = false) String orgCode,
|
||||
@RequestParam(value = "title", defaultValue = "", required = false) String title,
|
||||
@RequestParam(value = "openId") String openId) {
|
||||
IPage<SuppliersOrgAllEntity> result = suppliersApi.getSuppliersOrgInfo(pageNo, pageSize, orgCode, title,openId);
|
||||
IPage<SuppliersOrgAllEntity> result = suppliersApi.getSuppliersOrgInfo(pageNo, pageSize, orgCode, title, openId);
|
||||
List<SuppliersOrgAllEntity> sourceRecords = result.getRecords();
|
||||
if (sourceRecords == null || sourceRecords.size() <= 0) {
|
||||
return Result.OK(result);
|
||||
|
|
@ -79,6 +82,7 @@ public class SuppliersApi {
|
|||
|
||||
/**
|
||||
* 供应商入驻机构
|
||||
*
|
||||
* @param suppliersOrgEntity
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -91,6 +95,7 @@ public class SuppliersApi {
|
|||
|
||||
/**
|
||||
* 获取供应商可入驻机构信息
|
||||
*
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param orgCode
|
||||
|
|
@ -105,7 +110,7 @@ public class SuppliersApi {
|
|||
@RequestParam(value = "orgCode", defaultValue = "", required = false) String orgCode,
|
||||
@RequestParam(value = "title", defaultValue = "", required = false) String title,
|
||||
@RequestParam(value = "openId") String openId) {
|
||||
IPage<SuppliersOrgAllEntity> result = suppliersApi.getApplySuppliersOrgInfo(pageNo, pageSize, orgCode, title,openId);
|
||||
IPage<SuppliersOrgAllEntity> result = suppliersApi.getApplySuppliersOrgInfo(pageNo, pageSize, orgCode, title, openId);
|
||||
List<SuppliersOrgAllEntity> sourceRecords = result.getRecords();
|
||||
if (sourceRecords == null || sourceRecords.size() <= 0) {
|
||||
return Result.OK(result);
|
||||
|
|
@ -115,13 +120,14 @@ public class SuppliersApi {
|
|||
|
||||
/**
|
||||
* 根据openId获取供应商信息
|
||||
*
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getSupInfoByOpenId")
|
||||
public Result<SuppliersApplyEntity> getSupInfoByOpenId(
|
||||
@RequestParam(value = "openId") String openId) {
|
||||
SuppliersApplyEntity result = suppliersApi.getSupInfoByOpenId(openId);
|
||||
@RequestParam(value = "openId") String openId, @RequestParam(value = "orgCode") String orgCode) {
|
||||
SuppliersApplyEntity result = suppliersApi.getSupInfoByOpenId(openId, orgCode);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,4 +71,8 @@ public class SuppliersApplyEntity implements Serializable {
|
|||
private String suppliersStatus;
|
||||
/**审核备注*/
|
||||
private java.lang.String auditContent;
|
||||
|
||||
private String orgCode;
|
||||
|
||||
public Boolean izModify;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue