diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 293b925353..6c9d46dbb5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.RSASignature; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -39,7 +40,9 @@ import com.epmet.excel.CustomerStaffExcel; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.send.SendMqMsgUtil; import com.epmet.service.CustomerStaffService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; @@ -57,7 +60,8 @@ import java.util.Map; @RestController @RequestMapping("customerstaff") public class CustomerStaffController { - + @Value("${epmet.login.privateKey}") + private String privateKey; @Autowired private CustomerStaffService customerStaffService; @Autowired @@ -500,7 +504,12 @@ public class CustomerStaffController { * @Date 10:03 2020-08-25 **/ @PostMapping(value = "customerlist") - public Result> customerList(@RequestBody CustomerListFormDTO formDTO){ + public Result> customerList(@RequestBody CustomerListFormDTO formDTO) throws Exception { + //解密密码 + if (StringUtils.isNotBlank(formDTO.getPhone())&&formDTO.getPhone().length() > 50) { + String phone = RSASignature.decryptByPrivateKey(formDTO.getPhone(), privateKey); + formDTO.setPhone(phone); + } return customerStaffService.selectCustomerList(formDTO); }