|
@@ -8,6 +8,7 @@ import com.yonge.cooleshow.biz.dal.entity.*;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.AuthStatusEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.MessageTypeEnum;
|
|
|
+import com.yonge.cooleshow.biz.dal.mapper.SysUserMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.mapper.TenantEntryRecordMapper;
|
|
|
import com.yonge.cooleshow.biz.dal.service.*;
|
|
|
import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
@@ -57,6 +58,9 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
|
|
|
@Autowired
|
|
|
private SysConfigService sysConfigService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserMapper sysUserMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询详情
|
|
|
* @param id 详情ID
|
|
@@ -177,35 +181,58 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
|
|
|
next.setCityName(codeNameMap.getOrDefault(next.getCityCode(), ""));
|
|
|
next.setRegionName(codeNameMap.getOrDefault(next.getRegionCode(), ""));
|
|
|
}
|
|
|
-
|
|
|
+ tenantInfos.stream().forEach(item->{
|
|
|
+ String name = tenantEntryRecordMapper.selectName(item.getVerifyUserId());
|
|
|
+ item.setVerifyUserName(name);
|
|
|
+ });
|
|
|
return page.setRecords(tenantInfos);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public TenantApplyRecordWrapper.TenantApplyRecord queryNow(TenantApplyRecordWrapper.TenantApplyRecordQuery query) {
|
|
|
+ Long id = query.getId();
|
|
|
//查询本次提交记录
|
|
|
TenantApplyRecordWrapper.TenantApplyRecord info = baseMapper.queryNow(query);
|
|
|
- Set<Integer> codes = new HashSet<>();
|
|
|
- codes.add(info.getCityCode());
|
|
|
- codes.add(info.getProvinceCode());
|
|
|
- codes.add(info.getRegionCode());
|
|
|
|
|
|
- //将地区码转化为对应的地名
|
|
|
- List<Integer> areaCodeList = new ArrayList<>();
|
|
|
- areaCodeList.addAll(codes);
|
|
|
+ //查询当前申请数据的状态
|
|
|
+ AuthStatusEnum status = info.getStatus();
|
|
|
|
|
|
- Map<Integer, String> codeNameMap = new HashMap<>();
|
|
|
+ if (status.equals(AuthStatusEnum.DOING)){
|
|
|
+ //如果是审核中 申请表取一条数据 审核表取一条数据
|
|
|
+ Set<Integer> codes = new HashSet<>();
|
|
|
+ codes.add(info.getCityCode());
|
|
|
+ codes.add(info.getProvinceCode());
|
|
|
+ codes.add(info.getRegionCode());
|
|
|
|
|
|
- if (!CollectionUtils.isEmpty(areaCodeList)) {
|
|
|
- List<SysArea> sysAreaList = sysAreaService.queryByCodes(areaCodeList);
|
|
|
- codeNameMap = sysAreaList.stream().collect(Collectors.toMap(SysArea::getCode,
|
|
|
- SysArea::getName));
|
|
|
+ //将地区码转化为对应的地名
|
|
|
+ List<Integer> areaCodeList = new ArrayList<>();
|
|
|
+ areaCodeList.addAll(codes);
|
|
|
+
|
|
|
+ Map<Integer, String> codeNameMap = new HashMap<>();
|
|
|
+
|
|
|
+ if (!CollectionUtils.isEmpty(areaCodeList)) {
|
|
|
+ List<SysArea> sysAreaList = sysAreaService.queryByCodes(areaCodeList);
|
|
|
+ codeNameMap = sysAreaList.stream().collect(Collectors.toMap(SysArea::getCode,
|
|
|
+ SysArea::getName));
|
|
|
+ }
|
|
|
+ info.setProvinceName(codeNameMap.get(info.getProvinceCode()));
|
|
|
+ info.setCityName(codeNameMap.get(info.getCityCode()));
|
|
|
+ info.setRegionName(codeNameMap.get(info.getRegionCode()));
|
|
|
+
|
|
|
+
|
|
|
+ //审核表取一条最新数据
|
|
|
+ TenantApplyRecordWrapper.LastRecord lastRecordEntry = baseMapper.selectEntry(id);
|
|
|
+ info.setLastApplyRecord(lastRecordEntry);
|
|
|
+ return info;
|
|
|
+ } else {
|
|
|
+ //如果是通过或者失败 审核表取前两条数据
|
|
|
+ TenantApplyRecordWrapper.TenantApplyRecord tenantApplyRecord = baseMapper.selectLastEntry(id);
|
|
|
+ TenantApplyRecordWrapper.LastRecord lastRecord = baseMapper.selectSecondEntry(id);
|
|
|
+ tenantApplyRecord.setLastApplyRecord(lastRecord);
|
|
|
+ return tenantApplyRecord;
|
|
|
}
|
|
|
|
|
|
- info.setProvinceName(codeNameMap.get(info.getProvinceCode()));
|
|
|
- info.setCityName(codeNameMap.get(info.getCityCode()));
|
|
|
- info.setRegionName(codeNameMap.get(info.getRegionCode()));
|
|
|
- return info;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -214,20 +241,20 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
|
|
|
Boolean ifPass = entry.getIfPass();
|
|
|
Long id = entry.getId();
|
|
|
TenantApplyRecord applyRecord = tenantApplyRecordMapper.selectById(id);
|
|
|
- TenantEntryRecord entryRecord = new TenantEntryRecord();
|
|
|
-
|
|
|
- entryRecord.setTenantApplyRecordId(applyRecord.getId());
|
|
|
- entryRecord.setName(applyRecord.getName());
|
|
|
- entryRecord.setLogo(applyRecord.getLogo());
|
|
|
- entryRecord.setProvinceCode(applyRecord.getProvinceCode());
|
|
|
- entryRecord.setCityCode(applyRecord.getCityCode());
|
|
|
- entryRecord.setRegionCode(applyRecord.getRegionCode());
|
|
|
- entryRecord.setUsername(applyRecord.getUsername());
|
|
|
- entryRecord.setPhone(applyRecord.getPhone());
|
|
|
- entryRecord.setVerifyUserId(verifyUserId);
|
|
|
- entryRecord.setReason(entry.getReason());
|
|
|
+ TenantApplyRecordWrapper.TenantApplyRecord tenantApplyRecord= new TenantApplyRecordWrapper.TenantApplyRecord();
|
|
|
+
|
|
|
+ tenantApplyRecord.setTenantApplyRecordId(applyRecord.getId());
|
|
|
+ tenantApplyRecord.setName(applyRecord.getName());
|
|
|
+ tenantApplyRecord.setLogo(applyRecord.getLogo());
|
|
|
+ tenantApplyRecord.setProvinceCode(applyRecord.getProvinceCode());
|
|
|
+ tenantApplyRecord.setCityCode(applyRecord.getCityCode());
|
|
|
+ tenantApplyRecord.setRegionCode(applyRecord.getRegionCode());
|
|
|
+ tenantApplyRecord.setUsername(applyRecord.getUsername());
|
|
|
+ tenantApplyRecord.setPhone(applyRecord.getPhone());
|
|
|
+ tenantApplyRecord.setVerifyUserId(verifyUserId);
|
|
|
+ tenantApplyRecord.setReason(entry.getReason());
|
|
|
if (ifPass == true){
|
|
|
- entryRecord.setStatus("PASS");
|
|
|
+ tenantApplyRecord.setStatus(AuthStatusEnum.PASS);
|
|
|
//更改当前记录的审核状态
|
|
|
tenantApplyRecordMapper.updateStatusById(id);
|
|
|
|
|
@@ -243,12 +270,19 @@ public class TenantApplyRecordServiceImpl extends ServiceImpl<TenantApplyRecordM
|
|
|
tenantInfo.setEnableFlag(true);
|
|
|
tenantInfoService.add(tenantInfo);
|
|
|
} else {
|
|
|
- entryRecord.setStatus("UNPASS");
|
|
|
+ tenantApplyRecord.setStatus(AuthStatusEnum.UNPASS);
|
|
|
tenantApplyRecordMapper.updateUnpassStatusById(id);
|
|
|
}
|
|
|
- tenantEntryRecordMapper.insert(entryRecord);
|
|
|
+
|
|
|
+ String name = tenantEntryRecordMapper.selectName(verifyUserId);
|
|
|
+ tenantApplyRecord.setVerifyUserName(name);
|
|
|
+
|
|
|
+ TenantEntryRecord tenantEntryRecord = JSON.parseObject(JSON.toJSONString(tenantApplyRecord), TenantEntryRecord.class);
|
|
|
+ tenantEntryRecordMapper.insert(tenantEntryRecord);
|
|
|
+
|
|
|
+
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
- sendMessage(entry, ifPass, entryRecord);
|
|
|
+ sendMessage(entry, ifPass, tenantEntryRecord);
|
|
|
});
|
|
|
return true;
|
|
|
}
|