|
@@ -1,7 +1,14 @@
|
|
package com.pj.project.tb_favorite_contacts;
|
|
package com.pj.project.tb_favorite_contacts;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+
|
|
|
|
+import com.pj.current.dto.APPLoginUserInfo;
|
|
|
|
+import com.pj.current.satoken.StpAPPUserUtil;
|
|
|
|
+import com.pj.enummj.DeleteStatus;
|
|
|
|
+import com.pj.project.tb_favorite_contacts.param.FavoriteContactsParam;
|
|
import com.pj.utils.so.SoMap;
|
|
import com.pj.utils.so.SoMap;
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
@@ -26,6 +33,23 @@ public class TbFavoriteContactsService extends ServiceImpl<TbFavoriteContactsMap
|
|
save(t);
|
|
save(t);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** 增 */
|
|
|
|
+ void appAdd(FavoriteContactsParam favoriteContactsParam){
|
|
|
|
+ //获取当前登陆人
|
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
|
+ if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
|
+ throw new SecurityException("当前登录账号信息已失效!");
|
|
|
|
+ TbFavoriteContacts t = new TbFavoriteContacts();
|
|
|
|
+ BeanUtils.copyProperties(favoriteContactsParam,t);
|
|
|
|
+ t.setFkAppUser(appLoginInfo.getFk());
|
|
|
|
+ //设置公共字段
|
|
|
|
+ t.setCreateTime(new Date());
|
|
|
|
+ t.setCreateName(appLoginInfo.getLoginName());
|
|
|
|
+ t.setCreateBy(appLoginInfo.getLoginId());
|
|
|
|
+ t.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
|
+ save(t);
|
|
|
|
+ }
|
|
|
|
+
|
|
/** 删 */
|
|
/** 删 */
|
|
void delete(Long id){
|
|
void delete(Long id){
|
|
removeById(id);
|
|
removeById(id);
|
|
@@ -46,6 +70,17 @@ public class TbFavoriteContactsService extends ServiceImpl<TbFavoriteContactsMap
|
|
List<TbFavoriteContacts> getList(SoMap so) {
|
|
List<TbFavoriteContacts> getList(SoMap so) {
|
|
return tbFavoriteContactsMapper.getList(so);
|
|
return tbFavoriteContactsMapper.getList(so);
|
|
}
|
|
}
|
|
|
|
+ /** 查集合 - 查询自己的装货地址 */
|
|
|
|
+ List<TbFavoriteContacts> getAppList(SoMap so) {
|
|
|
|
+ //获取当前登录人
|
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
|
+ if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
|
+ throw new SecurityException("当前登录账号信息已失效!");
|
|
|
|
+ //创建查询条件
|
|
|
|
+ so.put("fkAppUser",appLoginInfo.getFk());
|
|
|
|
+ so.put("deleteStatus", DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
|
+ return tbFavoriteContactsMapper.getList(so);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|