|
@@ -10,11 +10,13 @@ import com.ym.mec.auth.api.entity.SysRole;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.auth.api.enums.SysUserType;
|
|
|
import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
|
+import com.ym.mec.biz.dal.dao.TenantContractTemplateDao;
|
|
|
import com.ym.mec.biz.dal.dao.TenantInfoDao;
|
|
|
import com.ym.mec.biz.dal.dto.TenantConfigDto;
|
|
|
import com.ym.mec.biz.dal.dto.TenantInfoDto;
|
|
|
import com.ym.mec.biz.dal.dto.TenantProductInfoDto;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
|
+import com.ym.mec.biz.dal.entity.TenantContractTemplate;
|
|
|
import com.ym.mec.biz.dal.entity.TenantContractRecord.TenantContractRecordEnum;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.vo.PlatformServePageVo;
|
|
@@ -108,6 +110,7 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
@Autowired
|
|
|
@Lazy
|
|
|
private ContractService contractService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private SysAreaService sysAreaService;
|
|
|
@Autowired
|
|
@@ -116,6 +119,8 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
private TenantPreJoinService tenantPreJoinService;
|
|
|
@Autowired
|
|
|
private TenantContractRecordService tenantContractRecordService;
|
|
|
+ @Autowired
|
|
|
+ private TenantContractTemplateDao tenantContractTemplateDao;
|
|
|
|
|
|
@Value("${contract.baseDir:/var/pdf}")
|
|
|
private String contractBaseDir;
|
|
@@ -189,11 +194,32 @@ public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public void updateTenantInfo(TenantInfoDto dto) {
|
|
|
+
|
|
|
//查询机构信息
|
|
|
TenantInfo tenantInfo = Optional.ofNullable(dto)
|
|
|
.map(TenantInfoDto::getId)
|
|
|
.map(this::getById)
|
|
|
.orElseThrow(() -> new BizException("未找到该机构信息,机构信息不能为空!"));
|
|
|
+
|
|
|
+ Integer tenantId = tenantInfo.getId();
|
|
|
+
|
|
|
+ //是否修改了机构名称或机构编码
|
|
|
+ if(!StringUtils.equals(dto.getTsignName(), tenantInfo.getTsignName()) || !StringUtils.equals(dto.getTsignCode(), tenantInfo.getTsignCode())){
|
|
|
+ //升级机构协议版本号
|
|
|
+ TenantContractTemplate tenantContractTemplate = tenantContractTemplateDao.queryLatestContractTemplate(null, null, tenantId);
|
|
|
+ if(tenantContractTemplate != null){
|
|
|
+ baseMapper.getLocked(tenantId);
|
|
|
+
|
|
|
+ Integer maxVersion = tenantContractTemplateDao.queryMaxVersion();
|
|
|
+ int version = maxVersion == null ? 1 : maxVersion + 1;
|
|
|
+
|
|
|
+ tenantContractTemplate.setVersion(version);
|
|
|
+ Date date = new Date();
|
|
|
+ tenantContractTemplate.setUpdateTime(date);
|
|
|
+
|
|
|
+ tenantContractTemplateDao.update(tenantContractTemplate);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//机构状态 1已缴费,并且 机构注册的手机号与本次修改后的手机号不同,就证明本次修改了手机号 则需要修改机构的账号信息
|
|
|
if (1 == tenantInfo.getPayState() && !Objects.equals(tenantInfo.getPhone(), dto.getPhone())) {
|