|
@@ -5,7 +5,8 @@ import java.util.List;
|
|
|
|
|
|
import org.fouram.core.base.service.BaseService;
|
|
|
import org.fouram.entity.SapMessageUser;
|
|
|
-import org.fouram.entity.SapUser;
|
|
|
+import org.fouram.entity.WxUser;
|
|
|
+import org.fouram.enums.DelFlagEnum;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -13,7 +14,7 @@ import org.springframework.stereotype.Service;
|
|
|
public class SapMessageUserService extends BaseService {
|
|
|
|
|
|
@Autowired
|
|
|
- private SapUserService sapUserService;
|
|
|
+ private WxUserService wxUserService;
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
public List<SapMessageUser> selectList() throws Exception {
|
|
@@ -21,15 +22,15 @@ public class SapMessageUserService extends BaseService {
|
|
|
}
|
|
|
|
|
|
public void saveOne(String userId) throws Exception {
|
|
|
- SapUser sapUser = sapUserService.selectByUserId(userId);
|
|
|
- if (sapUser == null) {
|
|
|
- throwPromptException("参数userId未获取到对应用户");
|
|
|
+ WxUser wxUser = wxUserService.selectById(userId, userId, DelFlagEnum.ENABLE.getCode());
|
|
|
+ if (wxUser == null) {
|
|
|
+ throwPromptException("参数userId未获取到微信用户");
|
|
|
}
|
|
|
SapMessageUser sapMessageUser = selectByUserId(userId);
|
|
|
if (sapMessageUser != null) {
|
|
|
throwPromptException("该用户已保存");
|
|
|
}
|
|
|
- sapMessageUser = SapMessageUser.builder().userId(userId).name(sapUser.getName()).createDate(new Date()).build();
|
|
|
+ sapMessageUser = SapMessageUser.builder().userId(userId).name(wxUser.getName()).createDate(new Date()).build();
|
|
|
save("SapMessageUserMapper.saveOne", sapMessageUser);
|
|
|
}
|
|
|
|