|
@@ -914,17 +914,35 @@ public class OwnCompanyRelController extends BaseController
|
|
@DeleteMapping("/{launchScrId}")
|
|
@DeleteMapping("/{launchScrId}")
|
|
public R remove(@PathVariable String launchScrId) throws Exception
|
|
public R remove(@PathVariable String launchScrId) throws Exception
|
|
{
|
|
{
|
|
|
|
+ //获取当前操作员
|
|
|
|
+ LoginUser user = tokenService.getLoginUser();
|
|
|
|
+ String companyId = user.getSysUser().getCompanyId();
|
|
|
|
+ //获取链属信息实体
|
|
SysCompanyRel rel = iSysCompanyRelService.getById(launchScrId);
|
|
SysCompanyRel rel = iSysCompanyRelService.getById(launchScrId);
|
|
//发起者
|
|
//发起者
|
|
String launchCompanyId = rel.getScrLaunchCompanyId();
|
|
String launchCompanyId = rel.getScrLaunchCompanyId();
|
|
//接收方
|
|
//接收方
|
|
String receiveCompanyId = rel.getScrReceiveCompanyId();
|
|
String receiveCompanyId = rel.getScrReceiveCompanyId();
|
|
- //查询发起方企业类型
|
|
|
|
|
|
+ //查询发起方企业类型与名称
|
|
SysCompany sysCompany = iSysCompanyService.getById(launchCompanyId);
|
|
SysCompany sysCompany = iSysCompanyService.getById(launchCompanyId);
|
|
String launchType = sysCompany.getScyType();
|
|
String launchType = sysCompany.getScyType();
|
|
- //查询接收方企业类型
|
|
|
|
|
|
+ String launchCompanyName = sysCompany.getScyName();
|
|
|
|
+ //查询发起者经办人
|
|
|
|
+ LambdaQueryWrapper<SysUserCompanyRel> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(SysUserCompanyRel::getSucrCompanyId,launchCompanyId);
|
|
|
|
+ wrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
|
|
|
|
+ List<SysUserCompanyRel> launchUserList = iSysUserCompanyRelService.findSysUserCompanyRels(wrapper);
|
|
|
|
+ Long launchUser = launchUserList.get(0).getSucrUserId();
|
|
|
|
+ //查询接收方企业类型与名称
|
|
SysCompany company = iSysCompanyService.getById(receiveCompanyId);
|
|
SysCompany company = iSysCompanyService.getById(receiveCompanyId);
|
|
String receiveType = company.getScyType();
|
|
String receiveType = company.getScyType();
|
|
|
|
+ String receiveCompanyName = company.getScyName();
|
|
|
|
+ //查询接收方经办人
|
|
|
|
+ LambdaQueryWrapper<SysUserCompanyRel> receiveWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ receiveWrapper.eq(SysUserCompanyRel::getSucrCompanyId,receiveCompanyId);
|
|
|
|
+ receiveWrapper.eq(SysUserCompanyRel::getSucrHandler,"1");
|
|
|
|
+ List<SysUserCompanyRel> receiveUserList = iSysUserCompanyRelService.findSysUserCompanyRels(receiveWrapper);
|
|
|
|
+ Long receiveUser = receiveUserList.get(0).getSucrUserId();
|
|
//如果发起方为供应商,接收方为核心企业
|
|
//如果发起方为供应商,接收方为核心企业
|
|
if("00".equals(launchType) && "01".equals(receiveType)){
|
|
if("00".equals(launchType) && "01".equals(receiveType)){
|
|
//查询企业是否含有正在存在的业务(第二种情况(发起者为核心企业,接收者为供应商))
|
|
//查询企业是否含有正在存在的业务(第二种情况(发起者为核心企业,接收者为供应商))
|
|
@@ -983,6 +1001,17 @@ public class OwnCompanyRelController extends BaseController
|
|
iSysCompanySpareService.updateById(sysCompanySpare);
|
|
iSysCompanySpareService.updateById(sysCompanySpare);
|
|
}
|
|
}
|
|
iSysCompanyRelService.updateById(sysCompanyRel);
|
|
iSysCompanyRelService.updateById(sysCompanyRel);
|
|
|
|
+ String scrId = launchScrId;
|
|
|
|
+ if(companyId.equals(launchCompanyId)) {
|
|
|
|
+ //发送站内消息
|
|
|
|
+ String receiveTitle = "【" + launchCompanyName + "】" + "已取消与您的链属关系";
|
|
|
|
+ remoteSystemService.sendNotice(receiveCompanyId, scrId, receiveTitle, "01", "03", null, "0", receiveUser.toString(), null, null, null);
|
|
|
|
+ }
|
|
|
|
+ if(companyId.equals(receiveCompanyId)) {
|
|
|
|
+ //发送站内消息
|
|
|
|
+ String launchTitle = "【" + receiveCompanyName + "】" + "已取消与您的链属关系";
|
|
|
|
+ remoteSystemService.sendNotice(launchCompanyId, scrId, launchTitle, "01", "03", null, "0", launchUser.toString(), null, null, null);
|
|
|
|
+ }
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
|
|
|