Pārlūkot izejas kodu

Merge branch 'master' of http://git.zthymaoyi.com/wangchao/businessCard

高敬炎 2 gadi atpakaļ
vecāks
revīzija
38fe9b37a3
36 mainītis faili ar 1418 papildinājumiem un 210 dzēšanām
  1. 7 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardClassifyInfoService.java
  2. 64 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardExchangeInfoService.java
  3. 3 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardManagementInfoService.java
  4. 8 8
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICircleCardInfoService.java
  5. 45 1
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardClassifyInfoServiceImpl.java
  6. 165 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardExchangeInfoServiceImpl.java
  7. 20 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardHolderInfoServiceImpl.java
  8. 67 14
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardManagementInfoServiceImpl.java
  9. 1 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CertificateManagementInfoServiceImpl.java
  10. 7 6
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleCardInfoServiceImpl.java
  11. 42 10
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleManagementInfoServiceImpl.java
  12. 1 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CommonUserInfoServiceImpl.java
  13. 1 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/PersonalHomepageInfoServiceImpl.java
  14. 1 0
      unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/SearchRecordsInfoServiceImpl.java
  15. 2 0
      unimall-app-api/src/main/java/com/iotechn/unimall/app/api/commonUser/CommonUserServiceImpl.java
  16. 2 0
      unimall-core/src/main/java/com/iotechn/unimall/core/exception/ExceptionDefinition.java
  17. 25 0
      unimall-data/pom.xml
  18. 96 0
      unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardExchangeInfo.java
  19. 9 1
      unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardHolderInfo.java
  20. 20 2
      unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardManagementInfo.java
  21. 5 3
      unimall-data/src/main/java/com/iotechn/unimall/data/domain/CircleCardInfo.java
  22. 6 0
      unimall-data/src/main/java/com/iotechn/unimall/data/domain/CircleManagementInfo.java
  23. 14 0
      unimall-data/src/main/java/com/iotechn/unimall/data/mapper/CardExchangeInfoMapper.java
  24. 314 0
      unimall-data/src/main/java/com/iotechn/unimall/data/util/QRCodeUtil.java
  25. 9 0
      unimall-data/src/main/java/com/iotechn/unimall/data/util/SessionUtil.java
  26. 9 0
      unimall-data/src/main/resources/com/iotechn/unimall/data/mapper/CardExchangeInfoMapper.xml
  27. 18 4
      unimall-launcher/src/main/java/com/iotechn/unimall/launcher/controller/ApiController.java
  28. 54 1
      xiaochengxu/common/helper.js
  29. 2 0
      xiaochengxu/main.js
  30. 9 0
      xiaochengxu/pages.json
  31. 78 51
      xiaochengxu/pages/circle/circle.vue
  32. 100 10
      xiaochengxu/pages/circle/createCirclce.vue
  33. 5 0
      xiaochengxu/pages/index/index.vue
  34. 130 34
      xiaochengxu/pages/mySet/myInfo.vue
  35. 1 1
      xiaochengxu/pages/mySet/mySet.vue
  36. 78 64
      xiaochengxu/pages/mySet/newCard.vue

+ 7 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardClassifyInfoService.java

@@ -8,6 +8,7 @@ import com.iotechn.unimall.core.annotation.HttpParam;
 import com.iotechn.unimall.core.annotation.HttpParamType;
 import com.iotechn.unimall.core.annotation.param.NotNull;
 import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CardManagementInfo;
 import com.iotechn.unimall.data.model.Page;
 import java.util.Date;
 
@@ -37,6 +38,12 @@ public interface ICardClassifyInfoService{
 	@HttpMethod(description = "删除",  permissionName = "名片分类管理")
 	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
 
+	@HttpMethod(description = "置顶",  permissionName = "名片分类管理")
+	public Boolean top(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
+
+	@HttpMethod(description = "置顶默认分类",  permissionName = "名片分类管理")
+	public Boolean topDefault(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
+
 	@HttpMethod(description = "修改",  permissionName = "名片分类管理")
 	public Boolean update(@NotNull @HttpParam(name = "cardClassifyInfo", type = HttpParamType.COMMON, description = "名片分类") CardClassifyInfo cardClassifyInfo)throws ServiceException;
 

+ 64 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardExchangeInfoService.java

@@ -0,0 +1,64 @@
+package com.iotechn.unimall.admin.api.card;
+
+
+import com.iotechn.unimall.core.annotation.HttpMethod;
+import com.iotechn.unimall.core.annotation.HttpOpenApi;
+import com.iotechn.unimall.core.annotation.HttpParam;
+import com.iotechn.unimall.core.annotation.HttpParamType;
+import com.iotechn.unimall.core.annotation.param.NotNull;
+import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CardExchangeInfo;
+import com.iotechn.unimall.data.model.Page;
+import java.util.Date;
+
+/**
+ * 名片交换Service接口
+ * 
+ * @author jlb
+ * @date 2023-04-12
+ */
+@HttpOpenApi(group = "admin.unimall.cardExchangeInfo", description = "名片交换")
+public interface ICardExchangeInfoService{
+	@HttpMethod(description = "新增", permission = "admin:unimall:cardExchangeInfo:add", permissionParentName = "宠物管理", permissionName = "名片交换管理")
+	public Boolean add(@NotNull @HttpParam(name = "cardExchangeInfo", type = HttpParamType.COMMON, description = "名片交换") CardExchangeInfo cardExchangeInfo)throws ServiceException;
+
+	@HttpMethod(description = "列表", permission = "admin:unimall:cardExchangeInfo:list",permissionParentName = "宠物管理", permissionName = "名片交换管理")
+	public Page<CardExchangeInfo> list(
+								@HttpParam(name = "sendId", type = HttpParamType.COMMON, description = "发起人id") Long sendId,
+							@HttpParam(name = "receiveId", type = HttpParamType.COMMON, description = "接收人id") Long receiveId,
+							@HttpParam(name = "sendCardId", type = HttpParamType.COMMON, description = "发起人名片id") Long sendCardId,
+							@HttpParam(name = "receiveCardId", type = HttpParamType.COMMON, description = "接收人名片id") Long receiveCardId,
+							@HttpParam(name = "circleName", type = HttpParamType.COMMON, description = "圈子名称") String circleName,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态(1已接受3已拒绝5已过期)") String status,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+					@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+		@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)
+		throws ServiceException;
+
+	@HttpMethod(description = "删除", permission = "admin:unimall:cardExchangeInfo:delete",permissionParentName = "宠物管理", permissionName = "名片交换管理")
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")String id)throws ServiceException;
+
+	@HttpMethod(description = "修改", permission = "admin:unimall:cardExchangeInfo:update",permissionParentName = "宠物管理", permissionName = "名片交换管理")
+	public Boolean update(@NotNull @HttpParam(name = "cardExchangeInfo", type = HttpParamType.COMMON, description = "名片交换") CardExchangeInfo cardExchangeInfo,
+						  @HttpParam(name = "updateFlag", type = HttpParamType.COMMON, description = "updateFlag") String updateFlag)throws ServiceException;
+
+	@HttpMethod(description = "查询", permission = "admin:unimall:cardExchangeInfo:get",permissionParentName = "宠物管理", permissionName = "名片交换管理")
+	public CardExchangeInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
+	
+	@HttpMethod(description = "导出excl表", permission = "admin:unimall:cardExchangeInfo:export",permissionParentName = "宠物管理", permissionName = "名片交换管理")
+	public String export(
+								@HttpParam(name = "sendId", type = HttpParamType.COMMON, description = "发起人id") Long sendId,
+							@HttpParam(name = "receiveId", type = HttpParamType.COMMON, description = "接收人id") Long receiveId,
+							@HttpParam(name = "sendCardId", type = HttpParamType.COMMON, description = "发起人名片id") Long sendCardId,
+							@HttpParam(name = "receiveCardId", type = HttpParamType.COMMON, description = "接收人名片id") Long receiveCardId,
+							@HttpParam(name = "circleName", type = HttpParamType.COMMON, description = "圈子名称") String circleName,
+							@HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态(1已接受3已拒绝5已过期)") String status,
+							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
+							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
+							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
+				@HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
+	@HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit)throws ServiceException;
+	
+}

+ 3 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICardManagementInfoService.java

@@ -48,6 +48,9 @@ public interface ICardManagementInfoService{
 	@HttpMethod(description = "修改",  permissionName = "名片管理管理")
 	public Boolean update(@NotNull @HttpParam(name = "cardManagementInfo", type = HttpParamType.COMMON, description = "名片管理") CardManagementInfo cardManagementInfo)throws ServiceException;
 
+	@HttpMethod(description = "置顶",  permissionName = "名片管理管理")
+	public Boolean top(@NotNull @HttpParam(name = "cardManagementInfo", type = HttpParamType.COMMON, description = "名片管理") CardManagementInfo cardManagementInfo)throws ServiceException;
+
 	@HttpMethod(description = "查询", permissionName = "名片管理管理")
 	public CardManagementInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
 	

+ 8 - 8
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/ICircleCardInfoService.java

@@ -24,9 +24,9 @@ public interface ICircleCardInfoService{
 
 	@HttpMethod(description = "列表", permissionName = "圈子个人关系管理")
 	public Page<CircleCardInfo> list(
-					@HttpParam(name = "circleId", type = HttpParamType.COMMON, description = "圈子id") String circleId,
-							@HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "名片id") String cardId,
-							@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") String commonId,
+					@HttpParam(name = "circleId", type = HttpParamType.COMMON, description = "圈子id") Long circleId,
+							@HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "名片id") Long cardId,
+							@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
 							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
 							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
 							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,
@@ -35,19 +35,19 @@ public interface ICircleCardInfoService{
 		throws ServiceException;
 
 	@HttpMethod(description = "删除", permissionName = "圈子个人关系管理")
-	public Boolean delete(@NotNull @HttpParam(name = "circleId", type = HttpParamType.COMMON, description = "圈子id")String circleId)throws ServiceException;
+	public Boolean delete(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = " ")String id)throws ServiceException;
 
 	@HttpMethod(description = "修改",  permissionName = "圈子个人关系管理")
 	public Boolean update(@NotNull @HttpParam(name = "circleCardInfo", type = HttpParamType.COMMON, description = "圈子个人关系") CircleCardInfo circleCardInfo)throws ServiceException;
 
 	@HttpMethod(description = "查询",  permissionName = "圈子个人关系管理")
-	public CircleCardInfo get(@NotNull @HttpParam(name = "circleId", type = HttpParamType.COMMON, description = "圈子id")String circleId)throws ServiceException;
+	public CircleCardInfo get(@NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "")Long id)throws ServiceException;
 	
 	@HttpMethod(description = "导出excl表", permissionName = "圈子个人关系管理")
 	public String export(
-					@HttpParam(name = "circleId", type = HttpParamType.COMMON, description = "圈子id") String circleId,
-							@HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "名片id") String cardId,
-							@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") String commonId,
+					@HttpParam(name = "circleId", type = HttpParamType.COMMON, description = "圈子id") Long circleId,
+							@HttpParam(name = "cardId", type = HttpParamType.COMMON, description = "名片id") Long cardId,
+							@HttpParam(name = "commonId", type = HttpParamType.COMMON, description = "个人id") Long commonId,
 							@HttpParam(name = "gmtCreate", type = HttpParamType.COMMON, description = "") Date gmtCreate,
 							@HttpParam(name = "gmtUpdate", type = HttpParamType.COMMON, description = "") Date gmtUpdate,
 							@HttpParam(name = "deleteFlag", type = HttpParamType.COMMON, description = "删除标识") Long deleteFlag,

+ 45 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardClassifyInfoServiceImpl.java

@@ -2,9 +2,14 @@ package com.iotechn.unimall.admin.api.card.impl;
 
 import java.util.List;
 
+import com.iotechn.unimall.core.exception.AdminServiceException;
+import com.iotechn.unimall.core.exception.AppServiceException;
+import com.iotechn.unimall.core.exception.ExceptionDefinition;
+import com.iotechn.unimall.data.domain.CardManagementInfo;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
@@ -34,6 +39,13 @@ public class CardClassifyInfoServiceImpl implements ICardClassifyInfoService{
 		Date now = new Date();
 		cardClassifyInfo.setGmtCreate(now);
 		cardClassifyInfo.setGmtUpdate(now);
+		List<CardClassifyInfo> cardClassifyInfoList=cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
+				.eq("common_id",cardClassifyInfo.getCommonId())
+				.eq("delete_flag",0)
+				.eq("circle_name",cardClassifyInfo.getCircleName()));
+		if (cardClassifyInfoList.size()>0) {
+			throw new AppServiceException(ExceptionDefinition.CLASSIFY_REPEAT_ERROR);
+		}
 		return cardClassifyInfoMapper.insert(cardClassifyInfo)>0;
 	}
 
@@ -58,7 +70,7 @@ public class CardClassifyInfoServiceImpl implements ICardClassifyInfoService{
 												if (!StringUtils.isEmpty(deleteFlag)) {
 					wrapper.eq("delete_flag", deleteFlag);
 				}
-							wrapper.eq("delete_flag", 0);
+							wrapper.eq("delete_flag", 0).orderBy("top_marking",false);
 		List<CardClassifyInfo> list = cardClassifyInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
 		Integer count = cardClassifyInfoMapper.selectCount(wrapper);
 		return new Page<CardClassifyInfo>(list, page, limit, count);
@@ -72,12 +84,44 @@ public class CardClassifyInfoServiceImpl implements ICardClassifyInfoService{
 			CardClassifyInfo tmp =  cardClassifyInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
+				tmp.setGmtUpdate(new Date());
 				cardClassifyInfoMapper.updateById(tmp);
 			}
 		}
 		return true;
 	}
 
+	@Override
+	public Boolean top(CardClassifyInfo cardClassifyInfo) throws ServiceException {
+		CardClassifyInfo cardClassifyInfo1=cardClassifyInfoMapper.selectById(cardClassifyInfo.getId());
+		List<CardClassifyInfo> cardClassifyInfoList=cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
+				.eq("common_id",cardClassifyInfo1.getCommonId())
+				.eq("delete_flag",0));
+		if (!CollectionUtils.isEmpty(cardClassifyInfoList)) {
+			for (CardClassifyInfo aa : cardClassifyInfoList) {
+				aa.setTopMarking(0l);
+				cardClassifyInfoMapper.updateById(aa);
+			}
+		}
+		cardClassifyInfo1.setTopMarking(1l);
+		cardClassifyInfo1.setGmtUpdate(new Date());
+		return cardClassifyInfoMapper.updateById(cardClassifyInfo1)>0;
+	}
+
+	@Override
+	public Boolean topDefault(CardClassifyInfo cardClassifyInfo) throws ServiceException {
+		List<CardClassifyInfo> cardClassifyInfoList=cardClassifyInfoMapper.selectList(new EntityWrapper<CardClassifyInfo>()
+				.eq("common_id",cardClassifyInfo.getCommonId())
+				.eq("delete_flag",0));
+		if (!CollectionUtils.isEmpty(cardClassifyInfoList)) {
+			for (CardClassifyInfo aa : cardClassifyInfoList) {
+				aa.setTopMarking(0l);
+				cardClassifyInfoMapper.updateById(aa);
+			}
+		}
+		return true;
+	}
+
 	@Override
 	public Boolean update(CardClassifyInfo cardClassifyInfo) throws ServiceException {
 		Date now = new Date();

+ 165 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardExchangeInfoServiceImpl.java

@@ -0,0 +1,165 @@
+package com.iotechn.unimall.admin.api.card.impl;
+
+import java.util.List;
+
+import com.iotechn.unimall.admin.api.card.ICardExchangeInfoService;
+import com.iotechn.unimall.data.domain.CardExchangeInfo;
+import com.iotechn.unimall.data.domain.CardHolderInfo;
+import com.iotechn.unimall.data.mapper.CardExchangeInfoMapper;
+import com.iotechn.unimall.data.mapper.CardHolderInfoMapper;
+import com.iotechn.unimall.data.model.Page;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.iotechn.unimall.data.util.ExcelUtil;
+import org.apache.ibatis.session.RowBounds;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.iotechn.unimall.core.exception.ServiceException;
+import java.util.Date;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 名片交换Service业务层处理
+ * 
+ * @author jlb
+ * @date 2023-04-12
+ */
+@Service
+public class CardExchangeInfoServiceImpl implements ICardExchangeInfoService {
+	@Autowired
+	private CardExchangeInfoMapper cardExchangeInfoMapper;
+	@Autowired
+	private CardHolderInfoMapper cardHolderInfoMapper;
+	
+	@Override
+	public Boolean add(CardExchangeInfo cardExchangeInfo) throws ServiceException {
+		Date now = new Date();
+		cardExchangeInfo.setGmtCreate(now);
+		cardExchangeInfo.setGmtUpdate(now);
+		return cardExchangeInfoMapper.insert(cardExchangeInfo)>0;
+	}
+
+	@Override
+	public Page<CardExchangeInfo> list(Long sendId,Long receiveId,Long sendCardId,Long receiveCardId,String circleName,String status,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
+		Wrapper<CardExchangeInfo> wrapper = new EntityWrapper<CardExchangeInfo>();
+														if (!StringUtils.isEmpty(sendId)) {
+					wrapper.eq("send_id", sendId);
+				}
+												if (!StringUtils.isEmpty(receiveId)) {
+					wrapper.eq("receive_id", receiveId);
+				}
+												if (!StringUtils.isEmpty(sendCardId)) {
+					wrapper.eq("send_card_id", sendCardId);
+				}
+												if (!StringUtils.isEmpty(receiveCardId)) {
+					wrapper.eq("receive_card_id", receiveCardId);
+				}
+												if (!StringUtils.isEmpty(circleName)) {
+					wrapper.eq("circle_name", circleName);
+				}
+												if (!StringUtils.isEmpty(status)) {
+					wrapper.eq("status", status);
+				}
+												if (!StringUtils.isEmpty(gmtCreate)) {
+					wrapper.eq("gmt_create", gmtCreate);
+				}
+												if (!StringUtils.isEmpty(gmtUpdate)) {
+					wrapper.eq("gmt_update", gmtUpdate);
+				}
+												if (!StringUtils.isEmpty(deleteFlag)) {
+					wrapper.eq("delete_flag", deleteFlag);
+				}
+							wrapper.eq("delete_flag", 0);
+		List<CardExchangeInfo> list = cardExchangeInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		Integer count = cardExchangeInfoMapper.selectCount(wrapper);
+		return new Page<CardExchangeInfo>(list, page, limit, count);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public Boolean delete(String id) {
+		String[] ids = String.valueOf(id).split(",");
+		for (String tt:ids) {
+			CardExchangeInfo tmp =  cardExchangeInfoMapper.selectById(Long.parseLong(tt));
+			if(tmp != null){
+				tmp.setDeleteFlag(1L);
+				cardExchangeInfoMapper.updateById(tmp);
+			}
+		}
+		return true;
+	}
+
+	@Override
+	public Boolean update(CardExchangeInfo cardExchangeInfo,String updateFlag) throws ServiceException {
+		Date now = new Date();
+		cardExchangeInfo.setGmtUpdate(now);
+		//拉黑
+		if ("1".equals(updateFlag)){
+		}
+		//拒绝
+		else if ("2".equals(updateFlag)){
+			cardExchangeInfo.setStatus("3");
+		}
+		//接受
+		else{
+			cardExchangeInfo.setStatus("1");
+			//发起人名片夹添加数据
+			CardHolderInfo cardHolderInfo=new CardHolderInfo();
+			cardHolderInfo.setCardId(String.valueOf(cardExchangeInfo.getReceiveCardId()));
+			cardHolderInfo.setCommonId(cardExchangeInfo.getSendId());
+			cardHolderInfo.setGmtCreate(now);
+			cardHolderInfo.setGmtUpdate(now);
+			cardHolderInfoMapper.insert(cardHolderInfo);
+			//接收人名片夹添加数据
+			cardHolderInfo=new CardHolderInfo();
+			cardHolderInfo.setCardId(String.valueOf(cardExchangeInfo.getSendCardId()));
+			cardHolderInfo.setCommonId(cardExchangeInfo.getReceiveId());
+			cardHolderInfo.setGmtCreate(now);
+			cardHolderInfo.setGmtUpdate(now);
+			cardHolderInfoMapper.insert(cardHolderInfo);
+		}
+		return cardExchangeInfoMapper.updateById(cardExchangeInfo)>0;
+	}
+
+	@Override
+	public CardExchangeInfo get(Long id) throws ServiceException {
+		return cardExchangeInfoMapper.selectById(id);
+	}
+	
+	@Override
+	public String export(Long sendId,Long receiveId,Long sendCardId,Long receiveCardId,String circleName,String status,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
+		Wrapper<CardExchangeInfo> wrapper = new EntityWrapper<CardExchangeInfo>();
+														if (!StringUtils.isEmpty(sendId)) {
+					wrapper.eq("send_id", sendId);
+				}
+												if (!StringUtils.isEmpty(receiveId)) {
+					wrapper.eq("receive_id", receiveId);
+				}
+												if (!StringUtils.isEmpty(sendCardId)) {
+					wrapper.eq("send_card_id", sendCardId);
+				}
+												if (!StringUtils.isEmpty(receiveCardId)) {
+					wrapper.eq("receive_card_id", receiveCardId);
+				}
+												if (!StringUtils.isEmpty(circleName)) {
+					wrapper.eq("circle_name", circleName);
+				}
+												if (!StringUtils.isEmpty(status)) {
+					wrapper.eq("status", status);
+				}
+												if (!StringUtils.isEmpty(gmtCreate)) {
+					wrapper.eq("gmt_create", gmtCreate);
+				}
+												if (!StringUtils.isEmpty(gmtUpdate)) {
+					wrapper.eq("gmt_update", gmtUpdate);
+				}
+												if (!StringUtils.isEmpty(deleteFlag)) {
+					wrapper.eq("delete_flag", deleteFlag);
+				}
+							List<CardExchangeInfo> list = cardExchangeInfoMapper.selectList(wrapper);
+		ExcelUtil<CardExchangeInfo> util = new ExcelUtil<CardExchangeInfo>(CardExchangeInfo.class);
+		return util.exportExcel(list, "操作日志");
+	}
+}

+ 20 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardHolderInfoServiceImpl.java

@@ -3,7 +3,10 @@ package com.iotechn.unimall.admin.api.card.impl;
 import java.util.List;
 
 import com.iotechn.unimall.data.domain.CardManagementInfo;
+import com.iotechn.unimall.data.domain.CommonUserInfo;
+import com.iotechn.unimall.data.domain.PersonalHomepageInfo;
 import com.iotechn.unimall.data.mapper.CardManagementInfoMapper;
+import com.iotechn.unimall.data.mapper.CommonUserInfoMapper;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -33,12 +36,23 @@ public class CardHolderInfoServiceImpl implements ICardHolderInfoService{
 	private CardHolderInfoMapper cardHolderInfoMapper;
 	@Autowired
 	private CardManagementInfoMapper cardManagementInfoMapper;
+	@Autowired
+	private CommonUserInfoMapper commonUserInfoMapper;
 	
 	@Override
 	public Boolean add(CardHolderInfo cardHolderInfo) throws ServiceException {
 		Date now = new Date();
 		cardHolderInfo.setGmtCreate(now);
 		cardHolderInfo.setGmtUpdate(now);
+		//个人展示的二维码 相互交换
+		if (cardHolderInfo.getCardCommonId()!=null){
+			CardHolderInfo cardHolderInfo1=new CardHolderInfo();
+			cardHolderInfo1.setCardId(cardHolderInfo.getMyCardId());
+			cardHolderInfo1.setCommonId(cardHolderInfo.getCardCommonId());
+			cardHolderInfo1.setGmtCreate(now);
+			cardHolderInfo1.setGmtUpdate(now);
+			cardHolderInfoMapper.insert(cardHolderInfo1);
+		}
 		return cardHolderInfoMapper.insert(cardHolderInfo)>0;
 	}
 
@@ -71,6 +85,11 @@ public class CardHolderInfoServiceImpl implements ICardHolderInfoService{
 				if (cardManagementInfo!=null){
 					cardHolderInfo.setCardManagementInfo(cardManagementInfo);
 				}
+				//查看是否允许分享
+				CommonUserInfo commonUserInfo=commonUserInfoMapper.selectById(cardHolderInfo.getCommonId());
+				if (commonUserInfo!=null){
+					cardHolderInfo.setShareCard(commonUserInfo.getShareCard());
+				}
 			}
 		}
 		Integer count = cardHolderInfoMapper.selectCount(wrapper);
@@ -85,6 +104,7 @@ public class CardHolderInfoServiceImpl implements ICardHolderInfoService{
 			CardHolderInfo tmp =  cardHolderInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
+				tmp.setGmtUpdate(new Date());
 				cardHolderInfoMapper.updateById(tmp);
 			}
 		}

+ 67 - 14
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CardManagementInfoServiceImpl.java

@@ -2,13 +2,16 @@ package com.iotechn.unimall.admin.api.card.impl;
 
 import java.util.List;
 
-import com.iotechn.unimall.data.domain.CardHolderInfo;
-import com.iotechn.unimall.data.domain.CircleCardInfo;
+import com.iotechn.unimall.core.util.GeneratorUtil;
+import com.iotechn.unimall.data.util.QRCodeUtil;
+import com.iotechn.unimall.data.domain.*;
 import com.iotechn.unimall.data.mapper.CardHolderInfoMapper;
 import com.iotechn.unimall.data.mapper.CircleCardInfoMapper;
+import com.iotechn.unimall.data.mapper.PersonalHomepageInfoMapper;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
@@ -16,7 +19,6 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.iotechn.unimall.core.exception.ServiceException;
 import com.iotechn.unimall.data.util.ExcelUtil;
 import com.iotechn.unimall.data.mapper.CardManagementInfoMapper;
-import com.iotechn.unimall.data.domain.CardManagementInfo;
 import com.iotechn.unimall.admin.api.card.ICardManagementInfoService;
 import com.iotechn.unimall.data.model.Page;
 import java.util.Date;
@@ -32,16 +34,28 @@ public class CardManagementInfoServiceImpl implements ICardManagementInfoService
 	@Autowired
 	private CardManagementInfoMapper cardManagementInfoMapper;
 	@Autowired
+	private QRCodeUtil qrCodeUtil;
+	@Autowired
 	private CircleCardInfoMapper circleCardInfoMapper;
 	@Autowired
 	private CardHolderInfoMapper cardHolderInfoMapper;
+	@Autowired
+	private PersonalHomepageInfoMapper personalHomepageInfoMapper;
 	
 	@Override
 	public Boolean add(CardManagementInfo cardManagementInfo) throws ServiceException {
 		Date now = new Date();
 		cardManagementInfo.setGmtCreate(now);
 		cardManagementInfo.setGmtUpdate(now);
-		return cardManagementInfoMapper.insert(cardManagementInfo)>0;
+		cardManagementInfoMapper.insert(cardManagementInfo);
+		//更新数据库默认值
+		cardManagementInfo = cardManagementInfoMapper.selectById(cardManagementInfo.getId());
+		//二维码
+		String str = qrCodeUtil.getQRCodeImage(String.valueOf(cardManagementInfo.getId()), false, cardManagementInfo.getName(), GeneratorUtil.genUUId());
+		String str1 = qrCodeUtil.getQRCodeImage(cardManagementInfo.getId()+","+cardManagementInfo.getCommonId(), false, cardManagementInfo.getName(), GeneratorUtil.genUUId());
+		cardManagementInfo.setQrCode(str);
+		cardManagementInfo.setQrCodeMyself(str1);
+		return cardManagementInfoMapper.updateById(cardManagementInfo)>0;
 	}
 
 	@Override
@@ -86,8 +100,19 @@ public class CardManagementInfoServiceImpl implements ICardManagementInfoService
 												if (!StringUtils.isEmpty(deleteFlag)) {
 					wrapper.eq("delete_flag", deleteFlag);
 				}
-							wrapper.eq("delete_flag", 0);
+							wrapper.eq("delete_flag", 0).orderBy("top_marking",false);
 		List<CardManagementInfo> list = cardManagementInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		if (!CollectionUtils.isEmpty(list)){
+			for (CardManagementInfo cardManagementInfo:list){
+				PersonalHomepageInfo personalHomepageInfo=new PersonalHomepageInfo();
+				personalHomepageInfo.setCommonId(cardManagementInfo.getCommonId());
+				personalHomepageInfo.setDeleteFlag(0l);
+				PersonalHomepageInfo personalHomepageInfo1=personalHomepageInfoMapper.selectOne(personalHomepageInfo);
+				if (personalHomepageInfo1!=null){
+					cardManagementInfo.setPersonalHomeId(personalHomepageInfo1.getId());
+				}
+			}
+		}
 		Integer count = cardManagementInfoMapper.selectCount(wrapper);
 		return new Page<CardManagementInfo>(list, page, limit, count);
 	}
@@ -100,20 +125,31 @@ public class CardManagementInfoServiceImpl implements ICardManagementInfoService
 			CardManagementInfo tmp =  cardManagementInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				//退出关联的圈子
-				List<CircleCardInfo> list=circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>().eq("card_id",tmp.getId()));
-				for(CircleCardInfo aa:list){
-					aa.setDeleteFlag(1l);
-					circleCardInfoMapper.updateById(aa);
+				List<CircleCardInfo> list=circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>()
+						.eq("card_id",tmp.getId())
+						.eq("delete_flag",0));
+				if (!CollectionUtils.isEmpty(list)) {
+					for (CircleCardInfo aa : list) {
+						aa.setDeleteFlag(1l);
+						aa.setGmtUpdate(new Date());
+						circleCardInfoMapper.updateById(aa);
+					}
 				}
 				//从所有拥有此名片用户列表删除
 				if ("1".equals(deleteCondition)){
-					List<CardHolderInfo> cardHolderInfoList=cardHolderInfoMapper.selectList(new EntityWrapper<CardHolderInfo>().eq("card_id",tmp.getId()));
-					for(CardHolderInfo aa:cardHolderInfoList){
-						aa.setDeleteFlag(1l);
-						cardHolderInfoMapper.updateById(aa);
+					List<CardHolderInfo> cardHolderInfoList=cardHolderInfoMapper.selectList(new EntityWrapper<CardHolderInfo>()
+							.eq("card_id",tmp.getId())
+							.eq("delete_flag",0));
+					if (!CollectionUtils.isEmpty(cardHolderInfoList)) {
+						for (CardHolderInfo aa : cardHolderInfoList) {
+							aa.setDeleteFlag(1l);
+							aa.setGmtUpdate(new Date());
+							cardHolderInfoMapper.updateById(aa);
+						}
 					}
 				}
-				tmp.setCommonId(null);
+				tmp.setCommonId(-1l);
+				tmp.setGmtUpdate(new Date());
 				cardManagementInfoMapper.updateById(tmp);
 			}
 		}
@@ -127,6 +163,23 @@ public class CardManagementInfoServiceImpl implements ICardManagementInfoService
 		return cardManagementInfoMapper.updateById(cardManagementInfo)>0;
 	}
 
+	@Override
+	public Boolean top(CardManagementInfo cardManagementInfo) throws ServiceException {
+		CardManagementInfo cardManagementInfo1=cardManagementInfoMapper.selectById(cardManagementInfo.getId());
+		List<CardManagementInfo> cardManagementInfoList=cardManagementInfoMapper.selectList(new EntityWrapper<CardManagementInfo>()
+				.eq("common_id",cardManagementInfo1.getCommonId())
+				.eq("delete_flag",0));
+		if (!CollectionUtils.isEmpty(cardManagementInfoList)) {
+			for (CardManagementInfo aa : cardManagementInfoList) {
+				aa.setTopMarking(0l);
+				cardManagementInfoMapper.updateById(aa);
+			}
+		}
+		cardManagementInfo1.setTopMarking(1l);
+		cardManagementInfo1.setGmtUpdate(new Date());
+		return cardManagementInfoMapper.updateById(cardManagementInfo1)>0;
+	}
+
 	@Override
 	public CardManagementInfo get(Long id) throws ServiceException {
 		return cardManagementInfoMapper.selectById(id);

+ 1 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CertificateManagementInfoServiceImpl.java

@@ -72,6 +72,7 @@ public class CertificateManagementInfoServiceImpl implements ICertificateManagem
 			CertificateManagementInfo tmp =  certificateManagementInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
+				tmp.setGmtUpdate(new Date());
 				certificateManagementInfoMapper.updateById(tmp);
 			}
 		}

+ 7 - 6
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleCardInfoServiceImpl.java

@@ -38,7 +38,7 @@ public class CircleCardInfoServiceImpl implements ICircleCardInfoService{
 	}
 
 	@Override
-	public Page<CircleCardInfo> list(String circleId,String cardId,String commonId,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
+	public Page<CircleCardInfo> list(Long circleId,Long cardId,Long commonId,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
 		Wrapper<CircleCardInfo> wrapper = new EntityWrapper<CircleCardInfo>();
 									if (!StringUtils.isEmpty(circleId)) {
 					wrapper.eq("circle_id", circleId);
@@ -66,12 +66,13 @@ public class CircleCardInfoServiceImpl implements ICircleCardInfoService{
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public Boolean delete(String circleId) {
-		String[] ids = String.valueOf(circleId).split(",");
+	public Boolean delete(String id) {
+		String[] ids = String.valueOf(id).split(",");
 		for (String tt:ids) {
 			CircleCardInfo tmp =  circleCardInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
+				tmp.setGmtUpdate(new Date());
 				circleCardInfoMapper.updateById(tmp);
 			}
 		}
@@ -86,12 +87,12 @@ public class CircleCardInfoServiceImpl implements ICircleCardInfoService{
 	}
 
 	@Override
-	public CircleCardInfo get(String circleId) throws ServiceException {
-		return circleCardInfoMapper.selectById(circleId);
+	public CircleCardInfo get(Long id) throws ServiceException {
+		return circleCardInfoMapper.selectById(id);
 	}
 	
 	@Override
-	public String export(String circleId,String cardId,String commonId,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
+	public String export(Long circleId,Long cardId,Long commonId,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
 		Wrapper<CircleCardInfo> wrapper = new EntityWrapper<CircleCardInfo>();
 									if (!StringUtils.isEmpty(circleId)) {
 					wrapper.eq("circle_id", circleId);

+ 42 - 10
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CircleManagementInfoServiceImpl.java

@@ -1,15 +1,15 @@
 package com.iotechn.unimall.admin.api.card.impl;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
 
-import com.iotechn.unimall.data.domain.CardManagementInfo;
-import com.iotechn.unimall.data.domain.CircleCardInfo;
+import com.iotechn.unimall.data.domain.*;
 import com.iotechn.unimall.data.mapper.CardManagementInfoMapper;
 import com.iotechn.unimall.data.mapper.CircleCardInfoMapper;
+import com.iotechn.unimall.data.mapper.CommonUserInfoMapper;
 import org.apache.ibatis.session.RowBounds;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
@@ -17,10 +17,8 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.iotechn.unimall.core.exception.ServiceException;
 import com.iotechn.unimall.data.util.ExcelUtil;
 import com.iotechn.unimall.data.mapper.CircleManagementInfoMapper;
-import com.iotechn.unimall.data.domain.CircleManagementInfo;
 import com.iotechn.unimall.admin.api.card.ICircleManagementInfoService;
 import com.iotechn.unimall.data.model.Page;
-import java.util.Date;
 import org.springframework.transaction.annotation.Transactional;
 
 /**
@@ -37,21 +35,22 @@ public class CircleManagementInfoServiceImpl implements ICircleManagementInfoSer
 	private CircleCardInfoMapper circleCardInfoMapper;
 	@Autowired
 	private CardManagementInfoMapper cardManagementInfoMapper;
+	@Autowired
+	private CommonUserInfoMapper commonUserInfoMapper;
 	
 	@Override
 	public Boolean add(CircleManagementInfo circleManagementInfo) throws ServiceException {
 		Date now = new Date();
 		circleManagementInfo.setGmtCreate(now);
 		circleManagementInfo.setGmtUpdate(now);
+		//添加圈子状态默认未审核
+		circleManagementInfo.setStatus(0l);
 		return circleManagementInfoMapper.insert(circleManagementInfo)>0;
 	}
 
 	@Override
 	public Page<CircleManagementInfo> list(Long commonId,String circleName,String circleLabel,Long status,Date gmtCreate,Date gmtUpdate,Long deleteFlag, Integer page, Integer limit)throws ServiceException {
 		Wrapper<CircleManagementInfo> wrapper = new EntityWrapper<CircleManagementInfo>();
-														if (!StringUtils.isEmpty(commonId)) {
-					wrapper.eq("common_id", commonId);
-				}
 												if (!StringUtils.isEmpty(circleName)) {
 					wrapper.eq("circle_name", circleName);
 				}
@@ -72,6 +71,31 @@ public class CircleManagementInfoServiceImpl implements ICircleManagementInfoSer
 				}
 							wrapper.eq("delete_flag", 0);
 		List<CircleManagementInfo> list = circleManagementInfoMapper.selectPage(new RowBounds((page - 1) * limit, limit), wrapper);
+		if(!CollectionUtils.isEmpty(list)){
+			for (CircleManagementInfo circleManagementInfo:list){
+				List<CircleCardInfo> circleCardInfoList=circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>()
+						.eq("circle_id",circleManagementInfo.getId())
+						.eq("delete_flag",0));
+				circleManagementInfo.setCardNum(circleCardInfoList.size());
+				CircleCardInfo circleCardInfo=new CircleCardInfo();
+				circleCardInfo.setCommonId(commonId);
+				circleCardInfo.setCircleId(circleManagementInfo.getId());
+				circleCardInfo.setDeleteFlag(0l);
+				CircleCardInfo circleCardInfo1=circleCardInfoMapper.selectOne(circleCardInfo);
+				if (circleCardInfo1!=null){
+					circleManagementInfo.setAddedFlag(1l);
+				}
+				else {
+					circleManagementInfo.setAddedFlag(0l);
+				}
+			}
+		}
+		Collections.sort(list, new Comparator<CircleManagementInfo>() {
+			@Override
+			public int compare(CircleManagementInfo o1, CircleManagementInfo o2) {
+				return o1.getAddedFlag()>o2.getAddedFlag()?-1:(o1.getAddedFlag()==o2.getAddedFlag())?0:1;
+			}
+		});
 		Integer count = circleManagementInfoMapper.selectCount(wrapper);
 		return new Page<CircleManagementInfo>(list, page, limit, count);
 	}
@@ -84,6 +108,7 @@ public class CircleManagementInfoServiceImpl implements ICircleManagementInfoSer
 			CircleManagementInfo tmp =  circleManagementInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
+				tmp.setGmtUpdate(new Date());
 				circleManagementInfoMapper.updateById(tmp);
 			}
 		}
@@ -101,12 +126,19 @@ public class CircleManagementInfoServiceImpl implements ICircleManagementInfoSer
 	public CircleManagementInfo get(Long id) throws ServiceException {
 		CircleManagementInfo circleManagementInfo=circleManagementInfoMapper.selectById(id);
 		//查询圈子名片关系表
-		List<CircleCardInfo> circleCardInfoList=circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>().eq("circle_id",id));
+		List<CircleCardInfo> circleCardInfoList=circleCardInfoMapper.selectList(new EntityWrapper<CircleCardInfo>()
+				.eq("circle_id",id)
+				.eq("delete_flag",0));
 		List<CardManagementInfo> cardManagementInfoList=new ArrayList<>();
 		for(CircleCardInfo circleCardInfo:circleCardInfoList){
 			//查询名片信息
 			CardManagementInfo cardManagementInfo=cardManagementInfoMapper.selectById(circleCardInfo.getCardId());
 			if (cardManagementInfo!=null){
+				//查看是否允许圈子成员查看主页
+				CommonUserInfo commonUserInfo=commonUserInfoMapper.selectById(cardManagementInfo.getCommonId());
+				if (commonUserInfo!=null){
+					cardManagementInfo.setLookPage(commonUserInfo.getLookPage());
+				}
 				cardManagementInfoList.add(cardManagementInfo);
 			}
 		}

+ 1 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/CommonUserInfoServiceImpl.java

@@ -87,6 +87,7 @@ public class CommonUserInfoServiceImpl implements ICommonUserInfoService{
 			CommonUserInfo tmp =  commonUserInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				tmp.setDeleteFlag(1L);
+				tmp.setGmtUpdate(new Date());
 				commonUserInfoMapper.updateById(tmp);
 			}
 		}

+ 1 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/PersonalHomepageInfoServiceImpl.java

@@ -90,6 +90,7 @@ public class PersonalHomepageInfoServiceImpl implements IPersonalHomepageInfoSer
 			PersonalHomepageInfo tmp =  personalHomepageInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
+				tmp.setGmtUpdate(new Date());
 				personalHomepageInfoMapper.updateById(tmp);
 			}
 		}

+ 1 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/card/impl/SearchRecordsInfoServiceImpl.java

@@ -72,6 +72,7 @@ public class SearchRecordsInfoServiceImpl implements ISearchRecordsInfoService{
 			SearchRecordsInfo tmp =  searchRecordsInfoMapper.selectById(Long.parseLong(tt));
 			if(tmp != null){
 				tmp.setDeleteFlag(1l);
+				tmp.setGmtUpdate(new Date());
 				searchRecordsInfoMapper.updateById(tmp);
 			}
 		}

+ 2 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/commonUser/CommonUserServiceImpl.java

@@ -38,6 +38,8 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
 import com.iotechn.unimall.data.mapper.CommonUserInfoMapper;
 /**
  * Created by rize on 2019/6/30.

+ 2 - 0
unimall-core/src/main/java/com/iotechn/unimall/core/exception/ExceptionDefinition.java

@@ -384,6 +384,8 @@ public class ExceptionDefinition {
     
     public static final ServiceExceptionDefinition TABLE_IMPORT_ERROR=
             new ServiceExceptionDefinition(53017, "导入表失败");
+    public static final ServiceExceptionDefinition CLASSIFY_REPEAT_ERROR =
+            new ServiceExceptionDefinition(53018, "分类名称重复");
 
 
 

+ 25 - 0
unimall-data/pom.xml

@@ -18,6 +18,7 @@
 		<druid.version>1.1.14</druid.version>
 		<oshi.version>3.9.1</oshi.version>
 		<velocity.version>1.7</velocity.version>
+		<zxing.version>3.4.0</zxing.version>
 	</properties>
 
 	<dependencies>
@@ -122,6 +123,30 @@
 			<artifactId>spring-boot-starter-test</artifactId>
 			<scope>test</scope>
 		</dependency>
+
+		<!--二维码依赖-->
+		<dependency>
+			<groupId>com.google.zxing</groupId>
+			<artifactId>core</artifactId>
+			<version>${zxing.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.google.zxing</groupId>
+			<artifactId>javase</artifactId>
+			<version>${zxing.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-web</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-test</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-test</artifactId>
+		</dependency>
 	</dependencies>
 
 </project>

+ 96 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardExchangeInfo.java

@@ -0,0 +1,96 @@
+package com.iotechn.unimall.data.domain;
+
+import com.iotechn.unimall.data.domain.SuperDO;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.iotechn.unimall.core.framework.aspectj.lang.annotaion.Excel;
+import com.iotechn.unimall.core.framework.aspectj.lang.annotaion.Excel.ColumnType;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.enums.FieldFill;
+import com.iotechn.unimall.core.util.StringUtils;
+import java.util.Date;
+
+/**
+ * 名片交换对象 card_exchange_info
+ * 
+ * @author jlb
+ * @date 2023-04-12
+ */
+@Data
+@TableName("card_exchange_info")
+public class CardExchangeInfo extends SuperDO {
+    private static final long serialVersionUID = 1L;
+
+    /**  */
+    @TableId("id")
+    private Long id;
+
+    /** 发起人id */
+    @Excel(name = "发起人id")
+    @TableField("send_id")
+    private Long sendId;
+
+    /** 接收人id */
+    @Excel(name = "接收人id")
+    @TableField("receive_id")
+    private Long receiveId;
+
+    /** 发起人名片id */
+    @Excel(name = "发起人名片id")
+    @TableField("send_card_id")
+    private Long sendCardId;
+
+    /** 接收人名片id */
+    @Excel(name = "接收人名片id")
+    @TableField("receive_card_id")
+    private Long receiveCardId;
+
+    /** 圈子名称 */
+    @Excel(name = "圈子名称")
+    @TableField("circle_name")
+    private String circleName;
+
+    /** 状态(1已接受3已拒绝5已过期) */
+    @Excel(name = "状态(1已接受3已拒绝5已过期)")
+    @TableField("status")
+    private String status;
+
+    /**  */
+    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField("gmt_create")
+    private Date gmtCreate;
+
+    /**  */
+    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
+    @TableField("gmt_update")
+    private Date gmtUpdate;
+
+    /** 删除标识 */
+    @Excel(name = "删除标识")
+    @TableField("delete_flag")
+    private Long deleteFlag;
+    /**
+     * 修改标识 1拉黑2拒绝3接受
+     */
+    @TableField(exist = false)
+    private String updateFlag;
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("sendId", getSendId())
+            .append("receiveId", getReceiveId())
+            .append("sendCarId", getSendCardId())
+            .append("receiveCarId", getReceiveCardId())
+            .append("circleName", getCircleName())
+            .append("status", getStatus())
+            .append("gmtCreate", getGmtCreate())
+            .append("gmtUpdate", getGmtUpdate())
+            .append("deleteFlag", getDeleteFlag())
+            .toString();
+    }
+}

+ 9 - 1
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardHolderInfo.java

@@ -64,7 +64,15 @@ public class CardHolderInfo extends SuperDO {
     private Long deleteFlag;
     @TableField(exist = false)
     private CardManagementInfo cardManagementInfo;
-
+    /** 允许他人分享名片(1允许) */
+    @TableField(exist = false)
+    private Long shareCard;
+    /** 扫码名片归属人id */
+    @TableField(exist = false)
+    private Long cardCommonId;
+    /** 我的名片id */
+    @TableField(exist = false)
+    private String myCardId;
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 20 - 2
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CardManagementInfo.java

@@ -85,11 +85,21 @@ public class CardManagementInfo extends SuperDO {
     @TableField("head_sculpture")
     private String headSculpture;
 
-    /** 二维码 */
-    @Excel(name = "二维码")
+    /** 他人分享二维码 */
+    @Excel(name = "他人分享二维码")
     @TableField("qr_code")
     private String qrCode;
 
+    /** 个人展示二维码 */
+    @Excel(name = "个人展示二维码")
+    @TableField("qr_code_myself")
+    private String qrCodeMyself;
+
+    /** 置顶标识 */
+    @Excel(name = "置顶标识")
+    @TableField("top_marking")
+    private Long topMarking;
+
     /**  */
     @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
     @TableField("gmt_create")
@@ -109,6 +119,14 @@ public class CardManagementInfo extends SuperDO {
      */
     @TableField(exist = false)
     private String deleteCondition;
+    /**
+     * 主页id
+     */
+    @TableField(exist = false)
+    private Long personalHomeId;
+    /** 允许圈子成员查看主页(1允许) */
+    @TableField(exist = false)
+    private Long lookPage;
 
     @Override
     public String toString() {

+ 5 - 3
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CircleCardInfo.java

@@ -23,16 +23,18 @@ import java.util.Date;
 @TableName("circle_card_info")
 public class CircleCardInfo extends SuperDO {
     private static final long serialVersionUID = 1L;
-
+    /**  */
+    @TableId("id")
+    private Long id;
     /** 圈子id */
     @Excel(name = "圈子id")
     @TableField("circle_id")
-    private String circleId;
+    private Long circleId;
 
     /** 名片id */
     @Excel(name = "名片id")
     @TableField("card_id")
-    private String cardId;
+    private Long cardId;
 
     /** 个人id */
     @Excel(name = "个人id")

+ 6 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/CircleManagementInfo.java

@@ -66,6 +66,12 @@ public class CircleManagementInfo extends SuperDO {
 
     @TableField(exist = false)
     private List<CardManagementInfo> cardManagementInfoList;
+    /** 我的圈子标识 */
+    @TableField(exist = false)
+    private Long addedFlag;
+    /** 圈子内人数 */
+    @TableField(exist = false)
+    private Integer cardNum;
 
 
     @Override

+ 14 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/mapper/CardExchangeInfoMapper.java

@@ -0,0 +1,14 @@
+package com.iotechn.unimall.data.mapper;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.iotechn.unimall.data.domain.CardExchangeInfo;
+
+/**
+ * 名片交换Mapper接口
+ * 
+ * @author jlb
+ * @date 2023-04-12
+ */
+public interface CardExchangeInfoMapper extends BaseMapper<CardExchangeInfo> {
+
+}

+ 314 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/util/QRCodeUtil.java

@@ -0,0 +1,314 @@
+package com.iotechn.unimall.data.util;
+
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.ObjectMetadata;
+import com.aliyun.oss.model.PutObjectRequest;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.QRCodeWriter;
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import lombok.Getter;
+import lombok.SneakyThrows;
+import org.apache.http.entity.ContentType;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.stereotype.Component;
+import org.springframework.util.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+import sun.font.FontDesignMetrics;
+
+import javax.imageio.ImageIO;
+import java.awt.*;
+import java.awt.font.FontRenderContext;
+import java.awt.font.LineMetrics;
+import java.awt.geom.RoundRectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Properties;
+
+/**
+ * @Author:chengchangjiang
+ * @Description: 二维码Util类
+ * @Date:Created in 9:38 2021-09-03
+ */
+@Component
+public class QRCodeUtil implements InitializingBean {
+
+    @Value("${oss.aliyun.oss.basekUrl}")
+    private String baseUrl;
+    @Value("${oss.aliyun.oss.bucket}")
+    private String bucket;
+    @Autowired
+    private OSSClient ossClient;
+    @Value("${oss.aliyun.oss.endpoint}")
+    private String endpoint;
+
+    private String host;
+    @Override
+    public void afterPropertiesSet() throws Exception {
+        host = "http://" + bucket + "." + endpoint;
+    }
+
+    /***
+     * 生成二维码图片并上传OSS
+     * @param text 二维码内容
+     * @param width 宽度
+     * @param height 高度
+     * @param type 类型
+     * @param name 图片名字
+     * @return
+     */
+    public  String generateQRCodeImage(String text, int width, int height,String type,String name){
+        try {
+            QRCodeWriter qrCodeWriter = new QRCodeWriter();
+            Hashtable<EncodeHintType, Object> hints = new Hashtable();
+            hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
+            BitMatrix bitMatrix = qrCodeWriter.encode(type+"="+text, BarcodeFormat.QR_CODE, width, height,hints);
+
+            File file = new File( new String(("templates" + File.separator + name+".png").getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8));
+            if(!file.exists()){
+                boolean flag = file.mkdirs();
+            }
+            Path path = FileSystems.getDefault().getPath(file.getAbsoluteFile().getPath());
+
+            MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path);
+
+            FileInputStream fileInputStream = new FileInputStream(file.getAbsoluteFile());
+
+            MultipartFile multipartFile = new MockMultipartFile( ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
+            String result = upload(multipartFile,name);
+            file.delete();
+            return result;
+        }
+        catch (Exception e){
+            System.out.println("二维码异常:"+e.toString());
+            return "error";
+        }
+    }
+    /**
+     * 后台通过服务器间接传文件
+     * @param file
+     * @return
+     * @throws IOException
+     */
+    public  String upload(MultipartFile file, String sendCarNo) throws IOException {
+        ObjectMetadata objectMetadata = new ObjectMetadata();
+        objectMetadata.setContentLength(file.getSize());
+        objectMetadata.setContentType(file.getContentType());
+        PutObjectRequest putObjectRequest = new PutObjectRequest(bucket, "QRCode/" +sendCarNo+".png", file.getInputStream(), objectMetadata);
+        ossClient.putObject(putObjectRequest);
+        return baseUrl + "QRCode/" + sendCarNo+".png";
+    }
+
+    private static final int QRCODE_SIZE = 320; // 二维码尺寸,宽度和高度均是320
+    private static final String FORMAT_TYPE = "PNG"; // 二维码图片类型
+
+
+//    //1、生成带logo和底部文字得二维码
+//    @SneakyThrows
+//    @GetMapping("/getQrCode1")
+//    public void getQrCode1(HttpServletResponse response) {
+//        ServletOutputStream os = response.getOutputStream();
+//        BufferedImage bufferedImage = QRCodeUtil.getQRCodeImage("test", "底部文字");
+//        response.setContentType("image/png");
+//        ImageIO.write(bufferedImage,"png",os);
+//    }
+//    //2、生成不带logo和底部文字得二维码
+//    @SneakyThrows
+//    @GetMapping("/getQrCode2")
+//    public void getQrCode2(HttpServletResponse response) {
+//        ServletOutputStream os = response.getOutputStream();
+//        BufferedImage bufferedImage = QRCodeUtil.getQRCodeImage("test", false);
+//        response.setContentType("image/png");
+//        ImageIO.write(bufferedImage,"png",os);
+//    }
+//    //3、生成默认带logo不带底部文字得二维码
+//    @SneakyThrows
+//    @GetMapping("/getQrCode3")
+//    public void getQrCode3(HttpServletResponse response) {
+//        ServletOutputStream os = response.getOutputStream();
+//        BufferedImage bufferedImage = QRCodeUtil.generateQRCodeImage("test");
+//        response.setContentType("image/png");
+//        ImageIO.write(bufferedImage,"png",os);
+//    }
+//    //3、生成不带logo带底部文字得二维码
+//    @SneakyThrows
+//    public  getQrCode3(HttpServletResponse response) {
+//        ServletOutputStream os = response.getOutputStream();
+//        BufferedImage bufferedImage = QRCodeUtil.getQRCodeImage("test",false,
+//                "底部文字");
+//        response.setContentType("image/png");
+//        ImageIO.write(bufferedImage,"png",os);
+//    }
+
+
+    /**
+     * 获取二维码图片
+     *
+     * @param dataStr    二维码内容
+     * @param needLogo   是否需要添加logo
+     * @param bottomText 底部文字       为空则不显示
+     * @return
+     */
+    @SneakyThrows
+    public String getQRCodeImage(String dataStr, boolean needLogo, String bottomText ,String name) {
+        if (dataStr == null) {
+            throw new RuntimeException("未包含任何信息");
+        }
+        HashMap<EncodeHintType, Object> hints = new HashMap<>();
+        hints.put(EncodeHintType.CHARACTER_SET, "utf-8");    //定义内容字符集的编码
+        hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);        //定义纠错等级
+        hints.put(EncodeHintType.MARGIN, 1);
+        QRCodeWriter qrCodeWriter = new QRCodeWriter();
+        BitMatrix bitMatrix = qrCodeWriter.encode(dataStr, BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints);
+
+        int width = bitMatrix.getWidth();
+        int height = bitMatrix.getHeight();
+        int tempHeight = height;
+        if (StringUtils.hasText(bottomText)) {
+            tempHeight = tempHeight + 12;
+        }
+        BufferedImage image = new BufferedImage(width, tempHeight, BufferedImage.TYPE_INT_RGB);
+        for (int x = 0; x < width; x++) {
+            for (int y = 0; y < height; y++) {
+                image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF);
+            }
+        }
+        // 判断是否添加logo
+        if (needLogo) {
+            insertLogoImage(image);
+        }
+        // 判断是否添加底部文字
+        if (StringUtils.hasText(bottomText)) {
+            addFontImage(image, bottomText);
+        }
+
+        File file = new File( new String(("templates" + File.separator + name+".png").getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8));
+        if(!file.exists()){
+            boolean flag = file.mkdirs();
+        }
+        Path path = FileSystems.getDefault().getPath(file.getAbsoluteFile().getPath());
+
+//        ByteArrayOutputStream out = new ByteArrayOutputStream();
+//        ImageIO.write(image,"png",path);
+//        MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path);
+
+        //创建一个ByteArrayOutputStream
+        ByteArrayOutputStream os = new ByteArrayOutputStream();
+        //把BufferedImage写入ByteArrayOutputStream
+        ImageIO.write(image, "png", os);
+        //ByteArrayOutputStream转成InputStream
+        InputStream input = new ByteArrayInputStream(os.toByteArray());
+        //InputStream转成MultipartFile
+        MultipartFile multipartFile =new MockMultipartFile("file", "file.jpg", "text/plain", input);
+
+//        FileInputStream fileInputStream = new FileInputStream(file.getAbsoluteFile());
+//        MultipartFile multipartFile = new MockMultipartFile( ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
+        String result = upload(multipartFile,name);
+        file.delete();
+        return result;
+    }
+
+    /**
+     * 插入logo图片
+     *
+     * @param source 二维码图片
+     * @throws Exception
+     */
+    private static void insertLogoImage(BufferedImage source) throws Exception {
+        // 默认logo放于resource/static/image目录下
+        ClassPathResource classPathResource = new ClassPathResource("static/image/logo.png");
+        InputStream inputStream = classPathResource.getInputStream();
+        if (inputStream == null || inputStream.available() == 0) {
+            return;
+        }
+        Image src = ImageIO.read(inputStream);
+        int width = 30;
+        int height = 30;
+
+        Image image = src.getScaledInstance(width, height, Image.SCALE_SMOOTH);
+        BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+        Graphics g = tag.getGraphics();
+        g.drawImage(image, 0, 0, null); // 绘制缩小后的图
+        g.dispose();
+        src = image;
+
+        // 插入LOGO
+        Graphics2D graph = source.createGraphics();
+        int x = (QRCODE_SIZE - width) / 2;
+        int y = (QRCODE_SIZE - height) / 2;
+        graph.drawImage(src, x, y, width, height, null);
+        Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6);
+        graph.setStroke(new BasicStroke(3f));
+        graph.draw(shape);
+        graph.dispose();
+    }
+
+    private static void addFontImage(BufferedImage source, String declareText) {
+        //生成image
+        int defineWidth = QRCODE_SIZE;
+        int defineHeight = 20;
+        BufferedImage textImage = new BufferedImage(defineWidth, defineHeight, BufferedImage.TYPE_INT_RGB);
+        Graphics2D g2 = (Graphics2D) textImage.getGraphics();
+        //开启文字抗锯齿
+        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,   RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+        g2.setBackground(Color.WHITE);
+        g2.clearRect(0, 0, defineWidth, defineHeight);
+        g2.setPaint(Color.BLACK);
+        FontRenderContext context = g2.getFontRenderContext();
+        String font_cn = getChineseFont();
+        //部署linux需要注意 linux无此字体会显示方块
+        Font font = new Font("宋体", Font.BOLD, 18);
+
+        g2.setFont(font);
+        LineMetrics lineMetrics = font.getLineMetrics(declareText, context);
+        FontMetrics fontMetrics = FontDesignMetrics.getMetrics(font);
+        float offset = (defineWidth - fontMetrics.stringWidth(declareText)) / 2;
+        float y = (defineHeight + lineMetrics.getAscent() - lineMetrics.getDescent() - lineMetrics.getLeading()) / 2;
+        g2.drawString(declareText, (int) offset, (int) y);
+
+        Graphics2D graph = source.createGraphics();
+        //开启文字抗锯齿
+        graph.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,   RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+        //添加image
+        int width = textImage.getWidth(null);
+        int height = textImage.getHeight(null);
+
+        Image src = textImage;
+        graph.drawImage(src, 0, QRCODE_SIZE - 8, width, height, Color.WHITE, null);
+        graph.dispose();
+    }
+    /**
+     * 获取中文字体位置
+     *
+     * @return
+     * @author xxj 2017年4月28日
+     */
+    private static String getChineseFont() {
+
+        //宋体(对应css中的 属性 font-family: SimSun; /*宋体*/)
+        String font1 = "templates" + File.separator + "msyh.ttc";
+//        String font1 = "templates" + File.separator + "simsun.ttf";
+        //判断系统类型,加载字体文件
+        Properties prop = System.getProperties();
+        String osName = prop.getProperty("os.name").toLowerCase();
+        System.out.println(osName);
+        if (osName.indexOf("linux") > -1) {
+            font1 = "/usr/share/fonts/chinese/simsun.ttc";
+        }
+        else{
+            font1 = "宋体";
+        }
+        return font1;
+    }
+}

+ 9 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/util/SessionUtil.java

@@ -2,6 +2,7 @@ package com.iotechn.unimall.data.util;
 
 
 import com.google.protobuf.ServiceException;
+import com.iotechn.unimall.data.domain.CommonUserInfo;
 import com.iotechn.unimall.data.dto.AdminDTO;
 import com.iotechn.unimall.data.dto.UserDTO;
 
@@ -13,6 +14,7 @@ import java.util.List;
 public class SessionUtil {
 
     private static ThreadLocal<UserDTO> userLocal = new ThreadLocal<>();
+    private static ThreadLocal<CommonUserInfo> commonLocal = new ThreadLocal<>();
 
     private static ThreadLocal<AdminDTO> adminLocal = new ThreadLocal<>();
 
@@ -23,6 +25,13 @@ public class SessionUtil {
     public static UserDTO getUser() {
         return userLocal.get();
     }
+    public static void setCommonUser(CommonUserInfo commonUserInfo) {
+        commonLocal.set(commonUserInfo);
+    }
+
+    public static CommonUserInfo getCommonUser() {
+        return commonLocal.get();
+    }
 
     public static void setAdmin(AdminDTO adminDTO) {
         adminLocal.set(adminDTO);

+ 9 - 0
unimall-data/src/main/resources/com/iotechn/unimall/data/mapper/CardExchangeInfoMapper.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iotechn.unimall.data.mapper.CardExchangeInfoMapper">
+    
+
+
+</mapper>

+ 18 - 4
unimall-launcher/src/main/java/com/iotechn/unimall/launcher/controller/ApiController.java

@@ -10,6 +10,7 @@ import com.iotechn.unimall.core.annotation.param.NotNull;
 import com.iotechn.unimall.core.annotation.param.Range;
 import com.iotechn.unimall.core.annotation.param.TextFormat;
 import com.iotechn.unimall.core.exception.ServiceException;
+import com.iotechn.unimall.data.domain.CommonUserInfo;
 import com.iotechn.unimall.data.domain.log.SysLogininfor;
 import com.iotechn.unimall.data.domain.log.SysOperLog;
 import com.iotechn.unimall.data.dto.AdminDTO;
@@ -120,7 +121,20 @@ public class ApiController {
 				operLog.setErrorMsg(e.getMessage());
 				operLog.setOperIp(BrowserData.getIpAddr(req));
 				operLog.setOperatorType(1);
-				operLog.setOperName(SessionUtil.getAdmin().getRealname());
+				if(SessionUtil.getAdmin() != null){
+					operLog.setOperName(SessionUtil.getAdmin().getRealname());
+				}
+				if(SessionUtil.getCommonUser() == null){
+					String accessToken = res.getHeader(Const.USER_ACCESS_TOKEN);
+					if (!StringUtils.isEmpty(accessToken)) {
+						String userJson = userRedisTemplate.opsForValue().get(Const.USER_REDIS_PREFIX + accessToken);
+						if (!StringUtils.isEmpty(userJson)) {
+							CommonUserInfo commonUserInfo = JSONObject.parseObject(userJson, CommonUserInfo.class);
+							SessionUtil.setCommonUser(commonUserInfo);
+							operLog.setOperName(commonUserInfo.getId()+"");
+						}
+					}
+				}
 				operLog.setOperUrl(_gp+"."+_mt);
 				operLog.setOperLocation(BrowserData.getAddresses(operLog.getOperIp()));
 				operLog.setStatus(1);
@@ -232,9 +246,9 @@ public class ApiController {
 					if (!StringUtils.isEmpty(accessToken)) {
 						String userJson = userRedisTemplate.opsForValue().get(Const.USER_REDIS_PREFIX + accessToken);
 						if (!StringUtils.isEmpty(userJson)) {
-							UserDTO userDTO = JSONObject.parseObject(userJson, UserDTO.class);
-							SessionUtil.setUser(userDTO);
-							args[i] = userDTO.getId();
+							CommonUserInfo commonUserInfo = JSONObject.parseObject(userJson, CommonUserInfo.class);
+							SessionUtil.setCommonUser(commonUserInfo);
+							args[i] = commonUserInfo.getId();
 							userRedisTemplate.expire(Const.USER_REDIS_PREFIX + accessToken, 30, TimeUnit.DAYS);
 							continue;
 						}

+ 54 - 1
xiaochengxu/common/helper.js

@@ -25,10 +25,63 @@ const logout = () => {
 		key: 'userInfo'
 	})
 }
+const formatLocation = (str) => {
+	let area = {}
+	let index11 = 0
+	let index1 = str.indexOf("省")
+	if (index1 == -1) {
+		index11 = str.indexOf("自治区")
+		if (index11 != -1) {
+			area.Province = str.substring(0, index11 + 3)
+		} else {
+			area.Province = str.substring(0, 0)
+		}
+	} else {
+		area.Province = str.substring(0, index1 + 1)
+	}
+
+	let index2 = str.indexOf("市")
+	if (index11 == -1) {
+		area.City = str.substring(index11 + 1, index2 + 1)
+	} else {
+		if (index11 == 0) {
+			area.City = str.substring(index1 + 1, index2 + 1)
+		} else {
+			area.City = str.substring(index11 + 3, index2 + 1)
+		}
+	}
+
+	let index3 = str.indexOf("区")
+	if (index3 == -1) {
+		index3 = str.indexOf("县")
+		if (index3 == -1) {
+			index3 = str.lastIndexOf("市")
+			if (index3 == -1) {
+				index3 = str.indexOf("镇")
+				if (index3 == -1) {
+
+				} else {
+					area.Country = str.substring(index2 + 1, index3 + 1)
+
+				}
+			} else {
+				area.Country = str.substring(index2 + 1, index3 + 1)
+			}
+		} else {
+			area.Country = str.substring(index2 + 1, index3 + 1)
+		}
+
+	} else {
+		area.Country = str.substring(index2 + 1, index3 + 1)
+	}
+	area.Village = str.substring(index3 + 1, str.length)
+	return area;
+}
 
 
 
 export default {
 logout,
-contactCustomerService
+contactCustomerService,
+formatLocation
 }

+ 2 - 0
xiaochengxu/main.js

@@ -5,10 +5,12 @@ import App from './App'
 
 Vue.config.productionTip = false
 import request from '@/util/request.js'
+import helper from '@/common/helper.js'
 import WXBizDataCrypt from '@/util/WXBizDataCrypt.js'
 import uView from '@/uni_modules/uview-ui'
 Vue.use(uView)
 Vue.prototype.$request = request
+Vue.prototype.$helper = helper
 import store from './store'
 Vue.prototype.$store = store
 import MescrollBody from "@/components/mescroll-uni/components/mescroll-body/mescroll-body.vue"

+ 9 - 0
xiaochengxu/pages.json

@@ -163,6 +163,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/mySet/editCard",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "编辑名片",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"tabBar": {
 		"custom": false,

+ 78 - 51
xiaochengxu/pages/circle/circle.vue

@@ -1,9 +1,6 @@
 <template>
 	<view class="content">
 		<view class="content1 flex">
-			<!-- <uni-search-bar @confirm="search" v-model="searchValue" @blur="blur" @focus="focus" @input="input"
-				@cancel="cancel" @clear="clear" cancelButton="false" placeholder="搜索圈子">
-			</uni-search-bar> -->
 			<view class="search flex flex-between" @click="search">
 				<view class="left flex">
 					<uni-icons type="search" size="24"></uni-icons>
@@ -18,37 +15,61 @@
 				<u-badge :isDot="true" type="error" class="point"></u-badge>
 			</view>
 		</view>
-		<view class="content2 flex flex-between">
-			<view class="left">
-				我得圈子
-			</view>
-			<view class="right">
-				<uni-icons type="personadd-filled" size="30" @click="toCreateCircle"></uni-icons>
+		<mescroll-body ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback">
+			<view class="content2 flex flex-between">
+				<view class="left">
+					我得圈子
+				</view>
+				<view class="right">
+					<uni-icons type="personadd-filled" size="30" @click="toCreateCircle"></uni-icons>
+				</view>
 			</view>
-		</view>
-		<!-- <mescroll-body ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback">
-					<view class="content3" v-for="(item,index) in circleList">
-			
+			<view class="" v-for="(item,index) in circleList" :key="index">
+				<view class="" v-if="item.name">
+					{{item.name}}
+				</view>
+				<view class="content3 flex" v-if="!item.name">
+					<view class="row-tiem" @click="toDetail">
+						<view class="left">
+							<image src="../../static/logo.png" mode="widthFix" class="img"></image>
+						</view>
+						<view class="right">
+							<view class="top">{{item.circleName}}({{item.cardNum}})</view>
+							<view class="bottom">
+								<span v-for="item1 in item.circleLabel.split(',')">
+									{{item1}}
+								</span>
+							</view>
+						</view>
 					</view>
-				</mescroll-body> -->
-		<view class="content3 flex">
-			<view class="row-tiem" @click="toDetail">
+				</view>
+			</view>
+			<!-- 		<view class="content2 flex flex-between">
 				<view class="left">
-					<image src="../../static/logo.png" mode="widthFix" class="img"></image>
+					我得圈子
 				</view>
 				<view class="right">
-					<view class="top">北京技术(155)</view>
-					<view class="bottom">
-						<span>粮食贸易</span>
-						<span>粮食贸易</span>
-						<span>粮食贸易</span>
-						<span>粮食贸易</span>
-					</view>
+					<uni-icons type="personadd-filled" size="30" @click="toCreateCircle"></uni-icons>
 				</view>
 			</view>
-
-		</view>
-	</view>
+			<view class="content3 flex">
+				<view class="row-tiem" @click="toDetail">
+					<view class="left">
+						<image src="../../static/logo.png" mode="widthFix" class="img"></image>
+					</view>
+					<view class="right">
+						<view class="top">北京技术(155)</view>
+						<view class="bottom">
+							<span>粮食贸易</span>
+							<span>粮食贸易</span>
+							<span>粮食贸易</span>
+							<span>粮食贸易</span>
+						</view>
+					</view>
+				</view>
+			</view> -->
+		</mescroll-body>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -65,30 +86,23 @@
 		},
 		data() {
 			return {
-					searchVal: '',
-				searchValue: '',
+				searchVal: '',
 				circleList: [],
 				userInfo: {},
+				firstTitle: false
 			};
 		},
 		onShow() {
 			this.searchVal = uni.getStorageSync("cirlce_search_val") ? uni.getStorageSync("cirlce_search_val") : ''
-			// this.$nextTick(function() {
-			// 	this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页  
-			// 	this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题  
-			// 	this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
-			// });
-			// if (this.hasLogin || uni.getStorageSync("userInfo").username) {
-			// 	this.userInfo = uni.getStorageSync("userInfo")
-			// 	this.isLogin = true
-			// } else {
-			// 	uni.navigateTo({
-			// 		url: "/pages/login/login"
-			// 	})
-			// }
+			this.userInfo = uni.getStorageSync("userInfo")
+			this.$nextTick(function() {
+				this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页  
+				this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题  
+				this.canReset = true // 过滤第一次的onShow事件,避免初始化界面时重复触发upCallback, 无需配置auto:false
+			});
 		},
 		methods: {
-			toCreateCircle(){
+			toCreateCircle() {
 				uni.navigateTo({
 					url: "/pages/circle/createCirclce"
 				})
@@ -110,10 +124,8 @@
 				uni.showLoading({
 					title: '数据加载中'
 				})
-				this.$request.baseRequest('pincheCarSharingApp', 'list', {
-					remark2: this.route,
-					carpoolingType: this.type,
-					companyId: 1,
+				this.$request.baseRequest('admin.unimall.circleManagementInfo', 'list', {
+					commonId: this.userInfo.id,
 					pageNum: page.num,
 					pageSize: page.size,
 				}, failres => {
@@ -124,7 +136,6 @@
 					})
 					uni.hideLoading()
 				}).then(res => {
-					// if (res.errno == 200) {
 					uni.hideLoading()
 					console.log(11)
 					let curPageData = res.data.items;
@@ -133,9 +144,25 @@
 					this.mescroll.endByPage(curPageLen, totalPage);
 					console.log(res.data)
 					// this.makeData(res.data)
-					if (page.num == 1) this.infoList = []; //如果是第一页需手动置空列表
-					this.infoList = this.infoList.concat(curPageData); //追加新数据
-					// }
+					if (page.num == 1) this.circleList = []; //如果是第一页需手动置空列表
+					this.circleList = this.circleList.concat(curPageData); //追加新数据
+					for (let i = 0; i < this.circleList.length; i++) {
+						if (!this.firstTitle && this.circleList[i].addedFlag == 0) {
+							this.firstTitle = true
+							if (i == 0) {
+								this.circleList.unshift({
+									name: '推荐圈子'
+								});
+							} else {
+								this.circleList.splice(i - 1, 0, {
+									name: '推荐圈子'
+								})
+							}
+							
+							console.log(this.circleList)
+							return
+						}
+					}
 				})
 			},
 			input(res) {

+ 100 - 10
xiaochengxu/pages/circle/createCirclce.vue

@@ -4,7 +4,7 @@
 		<uni-forms :modelValue="formData">
 			<view class="content1">
 				<uni-forms-item label="圈子名称" name="name">
-					<uni-easyinput type="text" v-model="formData.name" placeholder="输入圈子名称" />
+					<uni-easyinput type="text" v-model="formData.circleName" placeholder="输入圈子名称" />
 				</uni-forms-item>
 			</view>
 			<view class="content2">
@@ -12,29 +12,119 @@
 					圈子标签
 				</view>
 				<view class="">
-					<uni-forms-item label="标签1" name="name">
+					<uni-forms-item :label="'标签'+(index+1)" name="labelName" v-for="(item,index) in labelList"
+						:key="index">
 						<view class="flex">
-							<uni-easyinput type="text" v-model="formData.name" placeholder="输入圈子标签,2-4个字" />
-							<uni-icons type="plus-filled"></uni-icons>
-							<uni-icons type="minus-filled"></uni-icons>
+							<uni-easyinput type="text" v-model="item.labelName" placeholder="输入圈子标签,2-4个字" />
+							<uni-icons type="plus-filled" @click="add(item)" size="40"></uni-icons>
+							<uni-icons type="minus-filled" @click="subtract(index)" size="40"></uni-icons>
 						</view>
-						
 					</uni-forms-item>
 				</view>
 			</view>
-			<view class="">
-				<button type="primary">提交</button>
-			</view>
 		</uni-forms>
+
+		<view class="">
+			<button type="primary" @click="submit">提交</button>
+		</view>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
 <script>
+	var that;
 	export default {
 		data() {
 			return {
-				formData: {}
+				labelList: [{
+						labelName: ''
+					},
+					{
+						labelName: ''
+					}
+				],
+				formData: {
+					circleName: '',
+					circleLabel: [],
+					commonId: ''
+
+				}
 			};
+		},
+		onLoad() {
+			that = this
+			this.userInfo = uni.getStorageSync("userInfo")
+			this.formData.commonId = this.userInfo.id
+		},
+		methods: {
+			submit() {
+				this.formData.circleLabel = []
+				if (!this.formData.circleName) {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: '圈子名称不能为空!',
+					})
+					return
+				}
+				for (let i = 0; i < this.labelList.length; i++) {
+					if (!this.labelList[i].labelName) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: '标签内容不能为空!',
+						})
+						return
+					}
+					if (this.labelList[i].labelName.length > 4 || this.labelList[i].labelName.length < 2) {
+						this.$refs.uToast.show({
+							type: 'error',
+							message: '标签内容2-4个字!',
+						})
+						return
+					}
+					this.formData.circleLabel.push(this.labelList[i].labelName)
+				}
+				this.formData.circleLabel = this.formData.circleLabel.toString()
+
+				this.$request.baseRequest('admin.unimall.circleManagementInfo', 'add', {
+					circleManagementInfo: JSON.stringify(this.formData)
+				}, failres => {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.$refs.uToast.show({
+						type: 'success',
+						message: '提交成功!',
+					})
+					setTimeout(() => {
+						uni.navigateBack()
+					}, 500)
+				})
+			},
+			add() {
+				if (this.labelList.length > 3) {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: '“标签数量2-4个!',
+					})
+					return
+				}
+				this.labelList.push({
+					labelName: ''
+				})
+			},
+			subtract(index) {
+				if (this.labelList.length < 3) {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: '“标签数量2-4个!',
+					})
+					return
+				}
+				this.labelList.splice(index, 1)
+			},
 		}
 	}
 </script>

+ 5 - 0
xiaochengxu/pages/index/index.vue

@@ -9,6 +9,7 @@
 
 			</view>
 		</mescroll-body> -->
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -32,6 +33,10 @@
 			}
 		},
 		onShow() {
+			// this.$refs.uToast.show({
+			// 	type: 'success',
+			// 	message: '提交成功!',
+			// })
 			// this.$nextTick(function() {
 			// 	this.canReset && this.mescroll.resetUpScroll() // 重置列表数据为第一页  
 			// 	this.canReset && this.mescroll.scrollTo(0, 0) // 重置列表数据为第一页时,建议把滚动条也重置到顶部,避免无法再次翻页的问题  

+ 130 - 34
xiaochengxu/pages/mySet/myInfo.vue

@@ -3,46 +3,44 @@
 		<view class="card-list">
 			<view class="row" v-for="(item,index) in cardList" :key="index">
 				<view class="title-name">
-					名称
+					{{item.cardBusiness}}
 				</view>
 				<view class="flex card-list-item">
 					<view class="left">
 						<view class="top flex-row-center">
-							<image src="../../static/uni.png" mode="widthFix" class="img"></image>
+							<image :src="item.headSculpture" mode="widthFix" class="img"></image>
 						</view>
 						<view class="bottom flex flex-evenly">
+							<uni-icons type="home" size="20" @click="toHome(item)"></uni-icons>
 							<uni-icons type="home" size="20"></uni-icons>
-							<text>默</text>
 							<uni-icons type="redo" size="20"></uni-icons>
 						</view>
 					</view>
 					<view class="right">
 						<view class="row1 flex">
-							<text>张三</text>
+							<text>{{item.name}}</text>
 							<text class="line"></text>
-							<text>总经理</text>
+							<text>{{item.post}}</text>
 						</view>
 						<view class="row2">
-							北京xxx有限公司
+							{{item.companyName}}
 						</view>
 						<view class="row3" @click="toMap">
 							<uni-icons type="redo" size="20"></uni-icons>
-							<text>北京市朝阳区幸福大街8号</text>
+							<text>{{item.province}}{{item.city}}{{item.area}}{{item.detailedAddress}}</text>
 						</view>
 						<view class="row3">
 							<uni-icons type="redo" size="20"></uni-icons>
-							<text>13333333333</text>
-						</view>
-						<view class="row3">
-							<uni-icons type="redo" size="20"></uni-icons>
-							<text>我是备注</text>
+							<text>{{item.phone}}</text>
 						</view>
 					</view>
 				</view>
 				<view class="car-bottom flex">
-					<button>置顶</button>
-					<button>删除</button>
-					<button>编辑</button>
+					<u-button text="置顶" @click="topMarking(item)" throttle-time='1000'></u-button>
+					<!-- <button @click="$u.debounce(topMarking, 500)">置顶</button> -->
+					<!-- <button @click="$u.debounce(topMarking(item), 500)">置顶</button> -->
+					<u-button text="删除" @click="del(item.id)" throttle-time='1000'></u-button>
+					<button @click="toEditCard(item)">编辑</button>
 				</view>
 			</view>
 		</view>
@@ -51,35 +49,133 @@
 				<text class=''>添加新名片</text>
 			</view>
 		</view>
+		<u-toast ref="uToast"></u-toast>
+		<u-popup :show="isShowDel" @close="isShowDel=false" mode="center">
+			<view>
+				<text>删除名片自动退出关联得圈子,确定删除?</text>
+				<u-radio-group v-model="radiovalue" placement="column">
+					<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist" :key="index"
+						:label="item.name" :name="item.name" @change="radioChange">
+					</u-radio>
+				</u-radio-group>
+				<view class="flex">
+					<view class="">
+						取消
+					</view>
+					<view class="" @click="delCard">
+						删除
+					</view>
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
 <script>
-	import uploadImage from '@/components/ossutil/uploadFile.js';
+	var that;
 	export default {
 		data() {
 			return {
-				cardList: [{},
-					{}
-				]
+				id: '',
+				radiovalue: '仅从自己名片列表删除',
+				radiolist: [{
+						name: '仅从自己名片列表删除',
+						disabled: false
+					},
+					{
+						name: '从所有拥有此名片用户列表删除',
+						disabled: false
+					}
+				],
+				isShowDel: false,
+				cardList: []
 			};
 		},
-		methods:{
-			addCard(){
-				
+		onLoad() {
+			that = this
+			this.userInfo = uni.getStorageSync("userInfo")
+		},
+		onShow() {
+			this.init()
+		},
+		methods: {
+			radioChange(n) {
+				console.log('radioChange', n);
+			},
+			init() {
+				this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
+					commonId: this.userInfo.id
+				}, failres => {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.cardList = res.data.items
+				})
+			},
+			toEditCard(val) {
+				uni.navigateTo({
+					url: "/pages/mySet/editCard?itemVal="+JSON.stringify(val)
+				})
+			},
+			delCard() {
+				let _data = {}
+				if (this.radiovalue == '仅从自己名片列表删除') {
+					_data = {
+						id: this.id
+					}
+				} else {
+					_data = {
+						id: this.id,
+						deleteCondition: 1
+					}
+				}
+				that.$request.baseRequest('admin.unimall.cardManagementInfo', 'delete', _data, failres => {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.isShowDel = false
+					this.$refs.uToast.show({
+						type: 'success',
+						message: '删除成功!',
+					})
+					this.init()
+				})
+			},
+			del(val) {
+				this.id = val
+				this.isShowDel = true
+
+			},
+			addCard() {
+				uni.navigateTo({
+					url: "/pages/mySet/newCard"
+				})
+			},
+			topMarking(val) {
+				that.$request.baseRequest('admin.unimall.cardManagementInfo', 'top', {
+					cardManagementInfo: JSON.stringify({
+						id: val.id
+					})
+				}, failres => {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.$refs.uToast.show({
+						type: 'success',
+						message: '置顶成功!',
+					})
+					this.init()
+				})
 			}
-			// chooseImage(){
-			// 	uni.chooseImage({
-			// 		success: (res) => {
-			// 			uploadImage(res.tempFilePaths[0], 'cardImages/',
-			// 				result => {
-			// 					// this.trainImg = result
-			// 					uni.hideLoading();
-			// 				}
-			// 			)
-			// 		}
-			// 	});
-			// }
 		}
 	}
 </script>

+ 1 - 1
xiaochengxu/pages/mySet/mySet.vue

@@ -2,7 +2,7 @@
 	<view class="content">
 		<view class="content1 flex-all-center relative">
 			<view class="user">
-				<image src="../../static/logo.png" mode="widthFix" class="img"></image>
+				<image :src="userInfo.head" mode="widthFix" class="img"></image>
 				<view class="name">
 					{{userInfo.nickname}}
 				</view>

+ 78 - 64
xiaochengxu/pages/mySet/newCard.vue

@@ -6,10 +6,10 @@
 			</view>
 			<view class="right">
 				<view class="row1">
-					姓名|职务
+					{{cardInfo.name}}|{{cardInfo.post}}
 				</view>
 				<view class="">
-					公司名称
+					{{cardInfo.companyName}}
 				</view>
 				<view class="">
 					地址
@@ -30,26 +30,31 @@
 				名片信息
 			</view>
 			<u--form labelPosition="left" :model="cardInfo" ref="uForm">
-				<u-form-item label="名片标识" prop="userInfo.cardBusiness" borderBottom>
-					<text>名片-{{cardInfo.cardBusiness}}</text>
+				<u-form-item label="名片标识" prop="cardInfo.cardBusiness" borderBottom>
+					<u--input v-model="cardInfo.cardBusiness" border="none" placeholder="输入名片标识"></u--input>
 				</u-form-item>
-				<u-form-item label="姓名" prop="userInfo.name" borderBottom>
+				<u-form-item label="姓名" prop="cardInfo.name" borderBottom>
 					<u--input v-model="cardInfo.name" border="none" placeholder="输入姓名"></u--input>
 				</u-form-item>
-				<u-form-item label="职务" prop="userInfo.post" borderBottom>
+				<u-form-item label="职务" prop="cardInfo.post" borderBottom>
 					<u--input v-model="cardInfo.post" border="none" placeholder="输入职务,不超过8个字符"></u--input>
 				</u-form-item>
-				<u-form-item label="公司/机构名称" prop="userInfo.companyName" borderBottom>
+				<u-form-item label="公司/机构名称" prop="cardInfo.companyName" borderBottom>
 					<u--input v-model="cardInfo.companyName" border="none" placholder="输入公司/机构名称"></u--input>
 				</u-form-item>
-				<u-form-item label="定位" prop="userInfo.name" borderBottom  @click="placeSelect();hideKeyboard()">
-					<text>选择定位> </text>
 				</u-form-item>
-				<u-form-item label="详细地址" prop="userInfo.name" borderBottom>
-					<u--input v-model="cardInfo.name" border="none" placeholder="输入地址,不超过15个字"></u--input>
+				<!-- 		<u-form-item label="地址" prop="userInfo.name" borderBottom>
+					<view @click="showPicker">选择地址</view>
+					<view>{{ province }}{{ city }}{{ area }}</view>
+				</u-form-item> -->
+				<u-form-item label="定位" prop="cardInfo.name" borderBottom @click="placeSelect();hideKeyboard()">
+					<text>选择地址> </text>
 				</u-form-item>
-				<u-form-item label="联系电话" prop="userInfo.name" borderBottom>
-					<u--input v-model="cardInfo.name" border="none" placeholder="输入联系电话"></u--input>
+				<u-form-item label="详细地址" prop="cardInfo.name" borderBottom>
+					<u--input v-model="cardInfo.detailedAddress" border="none" placeholder="输入地址,不超过15个字"></u--input>
+				</u-form-item>
+				<u-form-item label="联系电话" prop="cardInfo.name" borderBottom>
+					<u--input v-model="cardInfo.phone" border="none" placeholder="输入联系电话"></u--input>
 				</u-form-item>
 			</u--form>
 		</view>
@@ -59,34 +64,45 @@
 			</view>
 			<view class="right">
 				<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
-					:maxCount="10"></u-upload>
+					:maxCount="1"></u-upload>
 			</view>
 		</view>
 		<view class="bottom">
-			<button>提交</button>
+			<button @click="submit">提交</button>
 		</view>
+		<city-picker ref="picker" mode="multiSelector" :list="areaData" :level="3" @confirm="finishSelectAddress">
+		</city-picker>
+		<u-modal :show="isSubmit" :content='content' @confirm="$u.debounce(confirmSubmit, 500)" showCancelButton
+			@cancel="isSubmit=false" @close="isSubmit=false" closeOnClickOverlay></u-modal>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
 <script>
+	var that;
 	import uploadImage from '@/components/ossutil/uploadFile.js';
 	export default {
+		onLoad() {
+			that = this
+			this.userInfo = uni.getStorageSync("userInfo")
+			this.cardInfo.commonId = this.userInfo.id
+		},
 		data() {
 			return {
+				isSubmit: false,
+				content: '确定提交名片信息?',
+				userInfo: {},
 				fileList1: [],
 				cardInfo: {
-					commonId:'',
-					cardBusiness:'',
-					name:'',
-					post:'',
-					companyName:'',
-					location:'',
-					detailedAddress:'',
-					phone:'',
-					headSculpture:''
-					
-					
-					
+					commonId: '',
+					cardBusiness: '名片标识-1',
+					name: '',
+					post: '',
+					companyName: '',
+					location: '',
+					detailedAddress: '',
+					phone: '',
+					headSculpture: ''
 				}
 			};
 		},
@@ -95,22 +111,12 @@
 				uni.chooseLocation({
 					success: function(res) {
 						console.log(res);
-						111
-						// console.log('位置名称:' + res.name);
-						// console.log('详细地址:' + res.address);
-						// console.log('纬度:' + res.latitude);
-						// console.log('经度:' + res.longitude);
-						this.cardInfo.location = res.latitude+','+res.longitude
-						this.
-						console.log('----------------------------')
-						// that.addressInfo.latitude = res.latitude
-						// that.addressInfo.longitude = res.longitude
-						// that.addressInfo.detailedAddress = _address.Village
-						// that.addressInfo.province = _address.Province
-						// that.addressInfo.city = _address.City
-						// that.addressInfo.area = _address.Country
-						// that.addressInfo.commonId = that.userInfo.id
-						// that.$forceUpdate()
+						that.cardInfo.location = res.latitude + ',' + res.longitude
+						let _address = that.$helper.formatLocation(res.address)
+						that.cardInfo.province = _address.Province
+						that.cardInfo.city = _address.City
+						that.cardInfo.area = _address.Country
+						that.cardInfo.detailedAddress = _address.Village
 					}
 				});
 			},
@@ -144,34 +150,42 @@
 					fileListLen++
 				}
 			},
-			uploadFilePromise(url) {
+			uploadFilePromise(res) {
 				return new Promise((resolve, reject) => {
-					uploadImage(res.tempFilePaths[0], 'cardImages/',
-									result => {
-										this.trainImg = result
-										uni.hideLoading();
-									}
-								)
-					// let a = uni.uploadFile({
-					// 	url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
-					// 	filePath: url,
-					// 	name: 'file',
-					// 	formData: {
-					// 		user: 'test'
-					// 	},
-					// 	success: (res) => {
-					// 		setTimeout(() => {
-					// 			resolve(res.data.data)
-					// 		}, 1000)
-					// 	}
-					// });
+					uploadImage(res, 'cardImages/',
+						result => {
+							that.cardInfo.headSculpture = result
+							resolve(res)
+						}
+					)
 				})
 			},
+			confirmSubmit() {
+				this.$request.baseRequest('admin.unimall.cardManagementInfo', 'add', {
+					cardManagementInfo: JSON.stringify(this.cardInfo)
+				}, failres => {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: failres.errmsg,
+					})
+					uni.hideLoading()
+				}).then(res => {
+					this.isSubmit = false
+					this.$refs.uToast.show({
+						type: 'success',
+						message: '提交成功!',
+					})
+				})
+			},
+			submit() {
+				this.isSubmit = true
+
+			}
 		}
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	.img {
 		width: 100rpx;
 	}