成交金额字段

This commit is contained in:
kuang.yife 2024-01-03 13:50:09 +08:00
parent 46ea5e5046
commit 31e8ac48bc
11 changed files with 254 additions and 1 deletions

1
.gitignore vendored
View File

@ -44,3 +44,4 @@ nbdist/
!*/build/*.java !*/build/*.java
!*/build/*.html !*/build/*.html
!*/build/*.xml !*/build/*.xml
/get-pip.py

View File

@ -2,9 +2,11 @@ package com.ruoyi.web.controller.system;
import java.security.GeneralSecurityException; import java.security.GeneralSecurityException;
import java.security.Key; import java.security.Key;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
@ -283,4 +285,23 @@ public class ClewController extends BaseController
return "system/clew/changeUser"; return "system/clew/changeUser";
} }
@PostMapping("/changeBatchUser")
@ResponseBody
public AjaxResult changeBatchUser(Clew clew)
{
if(StringUtils.isEmpty(clew.getIds())){
return AjaxResult.error("请选择线索!");
}
clew.setIdList(Arrays.stream(clew.getIds().split(",")).map(Long::parseLong).collect(Collectors.toList()));
return toAjax(clewService.updateBatchClew(clew));
}
@GetMapping("/changeBatchUser/{clewIds}")
public String changeBatchUser(@PathVariable("clewIds") String ids, ModelMap mmap)
{
mmap.put("clewIds", ids);
mmap.put("users", sysUserService.selectUserList(new SysUser()));
return "system/clew/changeBatchUser";
}
} }

View File

@ -18,6 +18,7 @@ import com.ruoyi.system.domain.ClewPhone;
import com.ruoyi.system.domain.NoticeRequest; import com.ruoyi.system.domain.NoticeRequest;
import com.ruoyi.system.domain.OppoCheck; import com.ruoyi.system.domain.OppoCheck;
import com.ruoyi.system.service.IClewPhoneService; import com.ruoyi.system.service.IClewPhoneService;
import com.ruoyi.web.core.config.GlobalLogHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -134,6 +135,27 @@ public class NoticeController {
log.info("请求{}的属性{}", url, content); log.info("请求{}的属性{}", url, content);
String s = HttpUtils.sendPost(url, content, headerMap); String s = HttpUtils.sendPost(url, content, headerMap);
log.info("请求{}的响应{}", url, s); log.info("请求{}的响应{}", url, s);
}else if("xiaomi".equalsIgnoreCase(request.getFrom())){
String imei = request.getImei();
String oaid = request.getOaid();
String ua = "Dalvik/2.1.0 (Linux; U; Android 11; M2012K11AC Build/RKQ1.200826.002)";
String clientIp = "127.0.0.1";
long convTime = System.currentTimeMillis();
String convType = "APP_PAY_NEW";
long appId = 1545362;
int customerId = 1545362;
String singKey = "IIUWoEaMXlzctOqk";
String encryptKey = "FkqMqeKVbCaeSGBI";
GlobalLogHelper.UploadInfo uploadInfo = GlobalLogHelper.UploadInfo.builder()
.imei(imei)
.oaid(oaid)
.ua(ua)
.clientIp(clientIp)
.convTime(convTime).convType(convType)
.appId(appId).customerId(customerId).signKey(singKey).encryptKey(encryptKey).build().genInfo();
log.info("请求xiaomi的属性{}", uploadInfo.getFinalUrl());
String s = HttpUtils.sendGet(uploadInfo.getFinalUrl());
log.info("请求xiaomi的响应{}", s);
}else { }else {
log.info("短信请求接口入参:{}", request); log.info("短信请求接口入参:{}", request);
} }

View File

@ -0,0 +1,131 @@
package com.ruoyi.web.core.config;
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import lombok.Builder;
import lombok.Data;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import java.math.BigInteger;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.List;
/**
* lombok 1.16.16.
*/
public class GlobalLogHelper {
@Data
@Builder
public static class UploadInfo {
//info设备信息
private String imei;
private String oaid;
private long convTime;
private String clientIp;
private String ua;
private long adId;
//conversion转化信息
private long appId;
private int customerId;
private String convType;
private String signKey;
private String encryptKey;
//生成的信息
//最终url
private String finalUrl;
//最终生成的info
private String finalInfo;
//queryString 设备信息
private String queryString;
private String property;
private String baseData;
//md5后的sign值
private String signature;
private final static String HOST = "http://trail.e.mi.com";
private final static String PATH = "/global/test";
@SneakyThrows
public UploadInfo genInfo() {
List<String> kvParam = new ArrayList<>();
if (StringUtils.isNotBlank(this.imei)) {
kvParam.add("imei=" + URLEncoder.encode(this.imei, "UTF-8"));
}
if (StringUtils.isNotBlank(this.oaid)) {
kvParam.add("oaid=" + URLEncoder.encode(this.oaid, "UTF-8"));
}
if (this.convTime > 0) {
kvParam.add("conv_time=" + URLEncoder.encode(String.valueOf(this.convTime), "UTF-8"));
}
if (StringUtils.isNotBlank(this.clientIp)) {
kvParam.add("client_ip=" + URLEncoder.encode(this.clientIp, "UTF-8"));
}
if (StringUtils.isNotBlank(this.ua)) {
kvParam.add("ua=" + URLEncoder.encode(this.ua, "UTF-8"));
}
if (this.adId > 0) {
kvParam.add("ad_id=" + URLEncoder.encode(String.valueOf(this.adId), "UTF-8"));
}
try {
//1.按照顺序使用 & 拼接key=urlEncode(value),queryString
this.queryString = String.join("&", kvParam);
//2.按照顺序使用 & 拼接签名密钥signKey urlEncode(queryString),得到property
this.property = this.signKey + "&" + URLEncoder.encode(this.queryString, "UTF-8");
//3. 将字符串(property) 进行md5(property)加密,得到32位小写字符串signature
this.signature = getMd5Digest(this.property);
} catch (Exception ignored) {
}
//4.按照顺序使用 & 拼接 queryString(注意是第一个步骤生成的) sign=signature
this.baseData = this.queryString + "&sign=" + this.signature;
//5.baseData进行加密 Base64(simple_xor{base_data, encrypt_key}),得到info信息
this.finalInfo = encrypt(this.baseData, this.encryptKey);
this.finalUrl = HOST + PATH
+ "?appId=" + URLEncoder.encode(String.valueOf(this.appId), "UTF-8")
+ "&info=" + URLEncoder.encode(this.finalInfo, "UTF-8")
+ "&conv_type=" + URLEncoder.encode(this.convType, "UTF-8")
+ "&customer_id=" + URLEncoder.encode(String.valueOf(this.customerId), "UTF-8");
return this;
}
//对baseData进行加密 Base64(simple_xor{base_data, encrypt_key})
public static String encrypt(String info, String key) {
try {
if (StringUtils.isEmpty(info) || StringUtils.isEmpty(key)) {
return null;
}
//6.1 base_data, encrypt_key 异或加密
char[] infoChar = info.toCharArray();
char[] keyChar = key.toCharArray();
byte[] resultChar = new byte[infoChar.length];
for (int i = 0; i < infoChar.length; i++) {
resultChar[i] = (byte) ((infoChar[i] ^ keyChar[i % keyChar.length]) & 0xFF);
}
//6.2 Base64 编码
return Base64.encode(resultChar);
} catch (Exception e) {
return null;
}
}
//md5 加密得到32位小写字符串.
public static String getMd5Digest(String pInput) {
try {
MessageDigest lDigest = MessageDigest.getInstance("MD5");
lDigest.update(pInput.getBytes("UTF-8"));
BigInteger lHashInt = new BigInteger(1, lDigest.digest());
return String.format("%1$032x", lHashInt);
} catch (Exception e) {
}
return "";
}
}
}

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('批量分配客服')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-change-user">
<input name="ids" type="hidden" th:value="${clewIds}" />
<div class="form-group">
<label class="col-sm-3 control-label">客服:</label>
<div class="col-sm-8">
<select id="saleId" name="saleId" class="form-control control-label" required>
<option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName}"></option>
</select>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
function submitHandler() {
if ($.validate.form()) {
$.operate.save(ctx + "system/clew/changeBatchUser", $('#form-change-user').serialize());
}
}
</script>
</body>
</html>

View File

@ -49,6 +49,9 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-primary multiple disabled" onclick="changeBatchUser()" shiro:hasPermission="system:clew:edit">
<i class="fa fa-remove"></i> 批量分配
</a>
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:clew:add"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:clew:add">
<i class="fa fa-plus"></i> 添加 <i class="fa fa-plus"></i> 添加
</a> </a>
@ -249,6 +252,18 @@
var url = prefix + '/changeUser/' + clewId; var url = prefix + '/changeUser/' + clewId;
$.modal.open("选择客服", url, '800', '300'); $.modal.open("选择客服", url, '800', '300');
} }
function changeBatchUser(){
table.set();
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
if (rows.length == 0) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
$.modal.confirm("确认分配吗?", function() {
$.modal.open("选择客服", prefix + '/changeBatchUser/' + rows.join(), '800', '300');
})
}
</script> </script>
</body> </body>
</html> </html>

View File

@ -1,6 +1,8 @@
package com.ruoyi.system.domain; package com.ruoyi.system.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
@ -20,6 +22,10 @@ public class Clew extends BaseEntity
/** 主键 */ /** 主键 */
private Long id; private Long id;
private String ids;
private List<Long> idList;
/** 广告主 */ /** 广告主 */
@Excel(name = "广告主") @Excel(name = "广告主")
private Long company; private Long company;

View File

@ -43,6 +43,8 @@ public interface ClewMapper
*/ */
public int updateClew(Clew clew); public int updateClew(Clew clew);
public int updateBatchClew(Clew clew);
/** /**
* 删除线索 * 删除线索
* *

View File

@ -43,6 +43,8 @@ public interface IClewService
*/ */
public int updateClew(Clew clew); public int updateClew(Clew clew);
public int updateBatchClew(Clew clew);
/** /**
* 批量删除线索 * 批量删除线索
* *

View File

@ -89,6 +89,13 @@ public class ClewServiceImpl implements IClewService
return clewMapper.updateClew(clew); return clewMapper.updateClew(clew);
} }
@Override
public int updateBatchClew(Clew clew)
{
clew.setUpdateTime(DateUtils.getNowDate());
return clewMapper.updateBatchClew(clew);
}
/** /**
* 批量删除线索 * 批量删除线索
* *

View File

@ -210,6 +210,22 @@
where id = #{id} where id = #{id}
</update> </update>
<update id="updateBatchClew" parameterType="Clew">
update clew
<trim prefix="SET" suffixOverrides=",">
<if test="saleId != null">sale_id = #{saleId},</if>
</trim>
<where>
<if test="idList != null and idList.size() > 0">
and id in
<foreach item="id" index="index" collection="idList" open="("
separator="," close=")">
#{id}
</foreach>
</if>
</where>
</update>
<delete id="deleteClewById" parameterType="Long"> <delete id="deleteClewById" parameterType="Long">
delete from clew where id = #{id} delete from clew where id = #{id}
</delete> </delete>