修改手机号

This commit is contained in:
kuang.yife 2023-12-10 12:03:57 +08:00
parent fe9c9aed30
commit 198561f8f1
6 changed files with 48 additions and 204 deletions

View File

@ -63,8 +63,10 @@ public class ClewController extends BaseController
@RequiresPermissions("system:clew:view")
@GetMapping()
public String clew()
public String clew(ModelMap modelMap)
{
List<SysUser> users = sysUserService.selectUserList(new SysUser());
modelMap.put("users", users);
return prefix + "/clew";
}
@ -138,6 +140,10 @@ public class ClewController extends BaseController
if (CollectionUtils.isNotEmpty(result)){
return AjaxResult.success();
}
// 不存在手机号则入库线索
clewService.insertClew(clew);
// 将初始线索设置成已跟踪
ClewPhone model = new ClewPhone();
model.setPhone(clew.getPhone());
@ -184,7 +190,7 @@ public class ClewController extends BaseController
e.printStackTrace();
log.error("回调oppo报错:{}", e.getMessage());
}
return toAjax(clewService.insertClew(clew));
return AjaxResult.success();
}
//huawei-归因

View File

@ -1,31 +0,0 @@
package com.ruoyi.web.controller.tool;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.minio.MinioUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
/**
* <p>minio文件服务</p>
* @author clunt
*/
@Controller
@RequestMapping("/tool/minio")
public class MinioController {
@ResponseBody
@PostMapping("/upload")
@ApiOperation(value = "文件上传管理-添加minio")
public AjaxResult add(@RequestPart("file") MultipartFile file) throws IOException {
String url = MinioUtils.uploadFile(file);
return AjaxResult.success(url);
}
}

View File

@ -15,16 +15,29 @@
<input type="text" name="phone"/>
</li>
<li>
<label>App来源</label>
<input type="text" name="sourceApp"/>
客服: <select name="saleId" id="saleId">
<option text="请选择" value=""></option>
<option th:each="user:${users}" th:value="${user.userId}"
th:text="${user.userName}"></option>
</select>
</li>
<li>
<label>省份:</label>
<input type="text" name="provinceName"/>
App来源<select name="remark" th:with="type=${@dict.getType('app_source')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>城市:</label>
<input type="text" name="cityName"/>
状态:<select name="searchStatus" th:with="type=${@dict.getType('follow_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>创建时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>

View File

@ -1,165 +0,0 @@
package com.ruoyi.common.utils.minio;
import io.minio.*;
import io.minio.messages.Bucket;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.PostConstruct;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* <p>minio文件服务管理</p>
*
* @author clunt
*/
@Slf4j
@Component
public class MinioUtils {
private static final String MINIO_KEY = "Wiu3PA9eP6wNjrGe";
private static final String MINIO_SECRET = "Q2th7VQEuUEc2r6wkywRdygn5c7T71LU";
private static final String MINIO_URL = "http://211.99.98.27:9001";
private static final ThreadLocal<SimpleDateFormat> dateFormatThreadLocal = ThreadLocal.withInitial(()->new SimpleDateFormat("_yyyyMMddHHmmss"));
private static final String MINIO_BUCKET = "bwy";
public static MinioClient minioClient;
/**
* 初始化minio配置
*/
@PostConstruct
public void init() {
try {
log.info("Minio Initialize........................");
minioClient = MinioClient.builder().endpoint(MINIO_URL).credentials(MINIO_KEY, MINIO_SECRET).build();
createBucket(MINIO_BUCKET);
log.info("Minio Initialize........................successful");
} catch (Exception e) {
e.printStackTrace();
log.error("初始化minio配置异常:", e.fillInStackTrace());
}
}
/**
* 判断bucket是否存在
*/
@SneakyThrows(Exception.class)
public static boolean bucketExists(String bucketName) {
return minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build());
}
/**
* 创建bucket
*/
@SneakyThrows(Exception.class)
public static void createBucket(String bucketName) {
boolean isExist = minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build());
if (!isExist) {
minioClient.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build());
}
}
/**
* 获取全部bucket
*/
@SneakyThrows(Exception.class)
public static List<Bucket> getAllBuckets() {
return minioClient.listBuckets();
}
/**
* 文件上传
*
* @param bucketName: 桶名
* @param fileName: 文件名
* @param filePath: 文件路径
*/
@SneakyThrows(Exception.class)
public static void upload(String bucketName, String fileName, String filePath) {
minioClient.putObject(PutObjectArgs.builder().bucket(bucketName).object(fileName).build());
}
/**
* 上传文件
* 返回可以直接预览文件的URL
*/
public static String uploadFile(MultipartFile file) {
try {
//如果存储桶不存在则创建
if (!bucketExists(MINIO_BUCKET)) {
createBucket(MINIO_BUCKET);
}
String contentType = file.getContentType();
String originalFilename = file.getOriginalFilename();
//得到文件流
InputStream inputStream = file.getInputStream();
//保证文件不重名(并且没有特殊字符)
String fileName = MINIO_BUCKET + dateFormatThreadLocal.get().format(new Date()) + originalFilename;
minioClient.uploadObject(UploadObjectArgs.builder()
.bucket(MINIO_BUCKET)
.object(file.getName())
.filename(originalFilename)
.build()
);
return getPreviewFileUrl(MINIO_BUCKET, fileName);
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
/**
* 文件上传
* 返回下载文件url地址 和下面upload方法仅传参不同
* bucketName 也可以直接从ParamConfig对象中获取
*/
// @SneakyThrows(Exception.class)
// public static String upload(String bucketName, String fileName, InputStream stream) {
// //bucketName, fileName, stream, new PutObjectOptions(stream.available(), -1)
// minioClient.putObject(PutObjectArgs.builder()..build()));
// return getPreviewFileUrl(bucketName, fileName);
// }
//
// /**
// * 文件上传
// * 返回下载文件url地址 和上面upload方法仅传参不同
// */
// @SneakyThrows(Exception.class)
// public static String upload(String bucketName, MultipartFile file) {
// final InputStream is = file.getInputStream();
// final String fileName = file.getOriginalFilename();
// minioClient.putObject(bucketName, fileName, is, new PutObjectOptions(is.available(), -1));
// is.close();
// return getPreviewFileUrl(bucketName, fileName);
// }
/**
* 删除文件
*
* @param bucketName: 桶名
* @param fileName: 文件名
*/
@SneakyThrows(Exception.class)
public static void deleteFile(String bucketName, String fileName) {
minioClient.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(fileName).build());
}
/**
* 获取minio文件的下载或者预览地址
* 取决于调用本方法的方法中的PutObjectOptions对象有没有设置contentType
*
* @param bucketName: 桶名
* @param fileName: 文件名
*/
@SneakyThrows(Exception.class)
public static String getPreviewFileUrl(String bucketName, String fileName) {
return minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder().bucket(bucketName).object(fileName).build());
}
}

View File

@ -127,6 +127,8 @@ public class Clew extends BaseEntity
@Excel(name = "客户情况备注")
private String customerRemark;
private String searchStatus;
private String imei;
private String oaid;

View File

@ -76,6 +76,25 @@
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="contactTime != null "> and contact_time = #{contactTime}</if>
<if test="otherPhone != null and otherPhone != ''"> and other_phone = #{otherPhone}</if>
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
<if test="searchStatus == '01'">
and is_add_wx = '1'
</if>
<if test="searchStatus == '02'">
and is_effective = '0'
</if>
<if test="searchStatus == '03'">
and is_plan = '1'
</if>
<if test="searchStatus == '04'">
and is_deal = '1'
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
order by create_time desc
</select>