|
@@ -168,6 +168,11 @@ public class PurchaseInformationServiceImpl implements PurchaseInformationServic
|
|
|
Integer allPurchaseIntentionListNum = purchaseInformationMapper.countAllPurchaseIntentionList(selectMap);
|
|
|
if (allPurchaseIntentionListNum > 0) {
|
|
|
List<Map<String, Object>> allPurchaseIntentionList = purchaseInformationMapper.getAllPurchaseIntentionList(selectMap);
|
|
|
+ for (Map<String, Object> purchaseMap : allPurchaseIntentionList) {
|
|
|
+ if (ObjectUtil.equal(purchaseMap.get("isShowContact"), 0)) {
|
|
|
+ purchaseMap.put("phone", "");
|
|
|
+ }
|
|
|
+ }
|
|
|
return SendUtil.layuiTable(allPurchaseIntentionListNum, allPurchaseIntentionList);
|
|
|
}
|
|
|
return SendUtil.layuiTable(allPurchaseIntentionListNum, null);
|
|
@@ -212,9 +217,16 @@ public class PurchaseInformationServiceImpl implements PurchaseInformationServic
|
|
|
isReleaseMark = true;
|
|
|
break;
|
|
|
}
|
|
|
- if (!ObjectUtil.equal(mapInfo.get("phone"), purchaseInformation.getPhone())) {
|
|
|
- isReleaseMark = true;
|
|
|
- break;
|
|
|
+ if (mapInfo.containsKey("phone")) {
|
|
|
+ if (!ObjectUtil.equal(mapInfo.get("phone"), purchaseInformation.getPhone())) {
|
|
|
+ isReleaseMark = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if (Blank.isNotEmpty(purchaseInformation.getPhone())) {
|
|
|
+ isReleaseMark = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
if (!ObjectUtil.equal(mapInfo.get("fitUpType"), purchaseInformation.getFitUpType())) {
|
|
|
isReleaseMark = true;
|
|
@@ -227,6 +239,14 @@ public class PurchaseInformationServiceImpl implements PurchaseInformationServic
|
|
|
if (isReleaseMark) {
|
|
|
//设置发布状态 0:未发布 1:已发布
|
|
|
purchaseInformation.setReleaseStatus(1);
|
|
|
+ //设置默认联系类型(默认为站内信)
|
|
|
+ if (purchaseInformation.getContactType() > 3 || purchaseInformation.getContactType() < 0) {
|
|
|
+ purchaseInformation.setContactType(0);
|
|
|
+ }
|
|
|
+ //默认不显示
|
|
|
+ if (purchaseInformation.getIsShowContact() > 1 || purchaseInformation.getIsShowContact() < 0) {
|
|
|
+ purchaseInformation.setIsShowContact(0);
|
|
|
+ }
|
|
|
Boolean insertPurchaseInfoRes = purchaseInformationMapper.insertPurchaseInfo(purchaseInformation);
|
|
|
if (!insertPurchaseInfoRes) {
|
|
|
return SendUtil.send(false, ConstString.RESULT_FAILED);
|
|
@@ -251,6 +271,14 @@ public class PurchaseInformationServiceImpl implements PurchaseInformationServic
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> updatePurchaseIntention(PurchaseInformation purchaseInformation) {
|
|
|
+ //设置默认联系类型(默认为站内信)
|
|
|
+ if (purchaseInformation.getContactType() > 3 || purchaseInformation.getContactType() < 0) {
|
|
|
+ purchaseInformation.setContactType(0);
|
|
|
+ }
|
|
|
+ //默认不显示
|
|
|
+ if (purchaseInformation.getIsShowContact() > 1 || purchaseInformation.getIsShowContact() < 0) {
|
|
|
+ purchaseInformation.setIsShowContact(0);
|
|
|
+ }
|
|
|
Boolean updateRes = purchaseInformationMapper.updatePurchaseIntention(purchaseInformation);
|
|
|
if (updateRes) {
|
|
|
return SendUtil.send(true, ConstString.RESULT_SUCCESS);
|