|
@@ -9,10 +9,12 @@ import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.ServiceException;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.SettledCompanyInfoMapper;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.ICommonUserService;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.ISettledCompanyContactsService;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.ISettledCompanyErrorService;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.ISettledCompanyInfoService;
|
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -43,8 +45,14 @@ public class SettledCompanyInfoServiceImpl extends ServiceImpl<SettledCompanyInf
|
|
|
@Autowired
|
|
|
private ISettledCompanyErrorService settledCompanyErrorService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private GeTuiUtils geTuiUtils;
|
|
|
+ @Autowired
|
|
|
+ private ICommonUserService commonUserService;
|
|
|
+
|
|
|
/**
|
|
|
* 添加入住公司信息
|
|
|
+ *
|
|
|
* @param settledCompanyInfo
|
|
|
* @return
|
|
|
*/
|
|
@@ -56,7 +64,7 @@ public class SettledCompanyInfoServiceImpl extends ServiceImpl<SettledCompanyInf
|
|
|
settledCompanyInfo.setStatus(StatusEnum.TO_BE_REVIEWED.getName());
|
|
|
// 联系人处理
|
|
|
List<SettledCompanyContacts> settledCompanyContactsList = settledCompanyInfo.getSettledCompanyContacts();
|
|
|
- if(!CollectionUtils.isEmpty(settledCompanyContactsList)){
|
|
|
+ if (!CollectionUtils.isEmpty(settledCompanyContactsList)) {
|
|
|
settledCompanyContactsList.forEach(settledCompanyContacts -> {
|
|
|
settledCompanyContacts.setId(IdGenerator.generateUUID());
|
|
|
settledCompanyContacts.setInfoId(settledCompanyInfo.getId());
|
|
@@ -69,6 +77,7 @@ public class SettledCompanyInfoServiceImpl extends ServiceImpl<SettledCompanyInf
|
|
|
|
|
|
/**
|
|
|
* 编辑入住公司信息
|
|
|
+ *
|
|
|
* @param settledCompanyInfo
|
|
|
* @return
|
|
|
*/
|
|
@@ -79,38 +88,36 @@ public class SettledCompanyInfoServiceImpl extends ServiceImpl<SettledCompanyInf
|
|
|
this.updateById(settledCompanyInfo);
|
|
|
// 联系人处理
|
|
|
List<SettledCompanyContacts> settledCompanyContactsList = settledCompanyContactsService.selectList(new EntityWrapper<SettledCompanyContacts>()
|
|
|
- .eq("info_id",settledCompanyInfo.getId()));
|
|
|
+ .eq("info_id", settledCompanyInfo.getId()));
|
|
|
List<String> idList = new ArrayList<>();
|
|
|
- if(!CollectionUtils.isEmpty(settledCompanyContactsList)){
|
|
|
- idList = settledCompanyContactsList.stream().map(SettledCompanyContacts::getId).collect(Collectors.toList());
|
|
|
+ if (!CollectionUtils.isEmpty(settledCompanyContactsList)) {
|
|
|
+ idList = settledCompanyContactsList.stream().map(SettledCompanyContacts::getId).collect(Collectors.toList());
|
|
|
}
|
|
|
List<SettledCompanyContacts> settledCompanyContactsListNew = settledCompanyInfo.getSettledCompanyContacts();
|
|
|
- if(!CollectionUtils.isEmpty(settledCompanyContactsListNew)){
|
|
|
- for(SettledCompanyContacts settledCompanyContacts:settledCompanyContactsListNew){
|
|
|
- if(StringUtils.isEmpty(settledCompanyContacts.getId())){
|
|
|
- settledCompanyContacts.setId(IdGenerator.generateUUID());
|
|
|
- settledCompanyContacts.setInfoId(settledCompanyInfo.getId());
|
|
|
- settledCompanyContactsService.insert(settledCompanyContacts);
|
|
|
- }
|
|
|
- else{
|
|
|
- settledCompanyContactsService.updateById(settledCompanyContacts);
|
|
|
- }
|
|
|
- }
|
|
|
+ if (!CollectionUtils.isEmpty(settledCompanyContactsListNew)) {
|
|
|
+ for (SettledCompanyContacts settledCompanyContacts : settledCompanyContactsListNew) {
|
|
|
+ if (StringUtils.isEmpty(settledCompanyContacts.getId())) {
|
|
|
+ settledCompanyContacts.setId(IdGenerator.generateUUID());
|
|
|
+ settledCompanyContacts.setInfoId(settledCompanyInfo.getId());
|
|
|
+ settledCompanyContactsService.insert(settledCompanyContacts);
|
|
|
+ } else {
|
|
|
+ settledCompanyContactsService.updateById(settledCompanyContacts);
|
|
|
+ }
|
|
|
+ }
|
|
|
List<String> idListNew = settledCompanyContactsListNew.stream().map(SettledCompanyContacts::getId).collect(Collectors.toList());
|
|
|
- if(!CollectionUtils.isEmpty(idList)){
|
|
|
- idList.forEach(s ->{
|
|
|
- if(!idListNew.contains(s)) {
|
|
|
+ if (!CollectionUtils.isEmpty(idList)) {
|
|
|
+ idList.forEach(s -> {
|
|
|
+ if (!idListNew.contains(s)) {
|
|
|
settledCompanyContactsService.deleteById(s);
|
|
|
}
|
|
|
- } );
|
|
|
+ });
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
- else{
|
|
|
- if(!CollectionUtils.isEmpty(idList)){
|
|
|
- idList.forEach(s ->{
|
|
|
+ } else {
|
|
|
+ if (!CollectionUtils.isEmpty(idList)) {
|
|
|
+ idList.forEach(s -> {
|
|
|
settledCompanyContactsService.deleteById(s);
|
|
|
- } );
|
|
|
+ });
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -118,9 +125,9 @@ public class SettledCompanyInfoServiceImpl extends ServiceImpl<SettledCompanyInf
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 入驻公司列表
|
|
|
+ *
|
|
|
* @param settledCompanyInfo
|
|
|
* @return
|
|
|
*/
|
|
@@ -130,16 +137,16 @@ public class SettledCompanyInfoServiceImpl extends ServiceImpl<SettledCompanyInf
|
|
|
pageView.put("startRecord", (settledCompanyInfo.getCurrentPage() - 1)
|
|
|
* settledCompanyInfo.getPageSize());
|
|
|
//公司id
|
|
|
- pageView.put("createPhone",settledCompanyInfo.getCreatePhone());
|
|
|
- pageView.put("mainBusinessType",settledCompanyInfo.getMainBusinessType());
|
|
|
- pageView.put("searchKeyWord",settledCompanyInfo.getSearchKeyWord());
|
|
|
- pageView.put("province",settledCompanyInfo.getProvince());
|
|
|
- pageView.put("city",settledCompanyInfo.getCity());
|
|
|
- pageView.put("area",settledCompanyInfo.getArea());
|
|
|
- pageView.put("detailedAddress",settledCompanyInfo.getDetailedAddress());
|
|
|
+ pageView.put("createPhone", settledCompanyInfo.getCreatePhone());
|
|
|
+ pageView.put("mainBusinessType", settledCompanyInfo.getMainBusinessType());
|
|
|
+ pageView.put("searchKeyWord", settledCompanyInfo.getSearchKeyWord());
|
|
|
+ pageView.put("province", settledCompanyInfo.getProvince());
|
|
|
+ pageView.put("city", settledCompanyInfo.getCity());
|
|
|
+ pageView.put("area", settledCompanyInfo.getArea());
|
|
|
+ pageView.put("detailedAddress", settledCompanyInfo.getDetailedAddress());
|
|
|
pageView.put("searchType", settledCompanyInfo.getSearchType());
|
|
|
- pageView.put("pageSize",settledCompanyInfo.getPageSize());
|
|
|
- pageView.put("currentPage",settledCompanyInfo.getCurrentPage());
|
|
|
+ pageView.put("pageSize", settledCompanyInfo.getPageSize());
|
|
|
+ pageView.put("currentPage", settledCompanyInfo.getCurrentPage());
|
|
|
// 查询总数
|
|
|
Integer dataCount = baseMapper.getCountByCondition(pageView);
|
|
|
List<SettledCompanyInfo> dataList = baseMapper.getListByCondition(pageView);
|
|
@@ -153,6 +160,7 @@ public class SettledCompanyInfoServiceImpl extends ServiceImpl<SettledCompanyInf
|
|
|
|
|
|
/**
|
|
|
* 查看详情
|
|
|
+ *
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
@@ -162,36 +170,68 @@ public class SettledCompanyInfoServiceImpl extends ServiceImpl<SettledCompanyInf
|
|
|
SettledCompanyInfo settledCompanyInfo = this.selectById(id);
|
|
|
// 联系人
|
|
|
List<SettledCompanyContacts> settledCompanyContactsList = settledCompanyContactsService.selectList(new EntityWrapper<SettledCompanyContacts>()
|
|
|
- .eq("info_id",settledCompanyInfo.getId()));
|
|
|
+ .eq("info_id", settledCompanyInfo.getId()));
|
|
|
// 举报
|
|
|
List<SettledCompanyError> settledCompanyErrors = settledCompanyErrorService.selectList(new EntityWrapper<SettledCompanyError>()
|
|
|
- .eq("info_id",settledCompanyInfo.getId()));
|
|
|
+ .eq("info_id", settledCompanyInfo.getId()));
|
|
|
settledCompanyInfo.setSettledCompanyContacts(settledCompanyContactsList);
|
|
|
settledCompanyInfo.setSettledCompanyErrorList(settledCompanyErrors);
|
|
|
return settledCompanyInfo;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 删除
|
|
|
- * @param id
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
public void deleteSettledCompanyInfo(String id) {
|
|
|
//查询销售计划信息
|
|
|
SettledCompanyInfo settledCompanyInfo = this.selectById(id);
|
|
|
- if(settledCompanyInfo != null){
|
|
|
+ if (settledCompanyInfo != null) {
|
|
|
//删除销售计划信息
|
|
|
this.deleteById(settledCompanyInfo.getId());
|
|
|
// 联系人
|
|
|
boolean result = settledCompanyContactsService.delete(new EntityWrapper<SettledCompanyContacts>()
|
|
|
- .eq("info_id",settledCompanyInfo.getId()));
|
|
|
+ .eq("info_id", settledCompanyInfo.getId()));
|
|
|
// 举报
|
|
|
boolean res = settledCompanyErrorService.delete(new EntityWrapper<SettledCompanyError>()
|
|
|
- .eq("info_id",settledCompanyInfo.getId()));
|
|
|
+ .eq("info_id", settledCompanyInfo.getId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核
|
|
|
+ *
|
|
|
+ * @param settledCompanyInfo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String examine(SettledCompanyInfo settledCompanyInfo) {
|
|
|
+ //查询
|
|
|
+ SettledCompanyInfo settledCompanyInfo1 = this.selectById(settledCompanyInfo.getId());
|
|
|
+ CommonUser commonUser = commonUserService.selectOne(new EntityWrapper<CommonUser>().eq("phone", settledCompanyInfo1.getCreatePhone()));
|
|
|
+ if (settledCompanyInfo1 != null) {
|
|
|
+ //通过
|
|
|
+ if (settledCompanyInfo.getFlag() == 1) {
|
|
|
+ settledCompanyInfo1.setStatusFlag(StatusEnum.ORDER_PASSED.getFlag());
|
|
|
+ settledCompanyInfo1.setStatus(StatusEnum.ORDER_PASSED.getName());
|
|
|
+ geTuiUtils.pushByCid("审核通知", "您的公司入住申请已审核通过", commonUser.getId());
|
|
|
+ }
|
|
|
+ //驳回
|
|
|
+ else {
|
|
|
+ settledCompanyInfo1.setStatusFlag(StatusEnum.ORDER_REJECTED.getFlag());
|
|
|
+ settledCompanyInfo1.setStatus(StatusEnum.ORDER_REJECTED.getName());
|
|
|
+ geTuiUtils.pushByCid("审核通知", "您的公司入住申请已被驳回", commonUser.getId());
|
|
|
+ }
|
|
|
+ //更改销售计划信息
|
|
|
+ this.updateById(settledCompanyInfo1);
|
|
|
+ return "OK";
|
|
|
}
|
|
|
+ return "NG";
|
|
|
}
|
|
|
|
|
|
|