|
|
|
@ -1,13 +1,20 @@ |
|
|
|
|
package com.dxhy.core.controller.mailGather; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.codec.Base64; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.dxhy.common.controller.AbstractController; |
|
|
|
|
import com.dxhy.common.utils.Base64Encoding; |
|
|
|
|
import com.dxhy.common.utils.R; |
|
|
|
|
import com.dxhy.common.vo.UserInfo; |
|
|
|
|
import com.dxhy.core.model.mailGather.EmailMaintainVo; |
|
|
|
|
import com.dxhy.core.service.mailGather.EmailMaintainService; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.util.Map; |
|
|
|
@ -18,6 +25,7 @@ import java.util.Map; |
|
|
|
|
* @author makejava |
|
|
|
|
* @since 2023-03-23 08:39:46 |
|
|
|
|
*/ |
|
|
|
|
@Slf4j |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("/emailMaintain") |
|
|
|
|
public class EmailMaintainController extends AbstractController { |
|
|
|
@ -46,10 +54,10 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
// return ResponseEntity.ok(R.ok().put("data", ""));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// pramsMap.put("gfsh", gfshList);
|
|
|
|
|
if (pramsMap.get("username") == null || "".equals(pramsMap.get("username"))) { |
|
|
|
|
return ResponseEntity.ok(R.error("收件人姓名不能为空!")); |
|
|
|
|
} |
|
|
|
|
UserInfo userInfo = getUserInfo(); |
|
|
|
|
log.debug("用户信息:{}", JSONObject.toJSONString(userInfo)); |
|
|
|
|
String loginname = getUserInfo().getLoginname(); |
|
|
|
|
pramsMap.put("userId",loginname); |
|
|
|
|
return ResponseEntity.ok(R.ok().put("data",this.emailMaintainService.queryByPage(pramsMap))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -105,5 +113,30 @@ public class EmailMaintainController extends AbstractController { |
|
|
|
|
return ResponseEntity.ok(R.error()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑数据 |
|
|
|
|
* |
|
|
|
|
* @param paramsMap 实体 |
|
|
|
|
* @return 编辑结果 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/getUserName") |
|
|
|
|
public ResponseEntity<R> getUserName(@RequestBody Map<String,String> paramsMap) { |
|
|
|
|
String userCode = paramsMap.get("userCode"); |
|
|
|
|
if(StringUtils.isEmpty(userCode)){ |
|
|
|
|
return ResponseEntity.ok(R.error("数据不能为空!")); |
|
|
|
|
} |
|
|
|
|
String userName = emailMaintainService.getUserName(userCode); |
|
|
|
|
if(StringUtils.isNotEmpty(userName)){ |
|
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
|
json.put("datalist", userName); |
|
|
|
|
log.debug("返回结果:{}", json.toJSONString()); |
|
|
|
|
String jsonString = Base64.encode(json.toJSONString()); |
|
|
|
|
return ResponseEntity.ok(R.ok().put("data",jsonString)); |
|
|
|
|
} |
|
|
|
|
return ResponseEntity.ok(R.error("未查询到相应数据!")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|