积分记录
This commit is contained in:
@@ -28,7 +28,7 @@ public class DataMigrationUtil extends Thread {
|
|||||||
// courseCatalogue();
|
// courseCatalogue();
|
||||||
// courseCatalogueChapter();
|
// courseCatalogueChapter();
|
||||||
// courseCatalogueChapterVideo();
|
// courseCatalogueChapterVideo();
|
||||||
// user();//用的都是copy表里的数据
|
user();//用的都是copy表里的数据
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,7 +361,7 @@ public class DataMigrationUtil extends Thread {
|
|||||||
DataMigrationUtil d1 = new DataMigrationUtil(list.get(i),i+1,fzdsconn);
|
DataMigrationUtil d1 = new DataMigrationUtil(list.get(i),i+1,fzdsconn);
|
||||||
service.execute(d1);
|
service.execute(d1);
|
||||||
}
|
}
|
||||||
System.out.println("---已插入数据");
|
System.out.println("---开始");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
System.out.println("Error: " + e.getMessage());
|
System.out.println("Error: " + e.getMessage());
|
||||||
}
|
}
|
||||||
@@ -374,9 +374,12 @@ public class DataMigrationUtil extends Thread {
|
|||||||
System.out.println("---已插入数据"+i+"--"+ DateUtil.format(new Date(),"YYYY-MM-dd HH:mm:ss"));
|
System.out.println("---已插入数据"+i+"--"+ DateUtil.format(new Date(),"YYYY-MM-dd HH:mm:ss"));
|
||||||
}
|
}
|
||||||
String userId = "";
|
String userId = "";
|
||||||
BigDecimal userBalance = new BigDecimal(0);
|
BigDecimal userBalanceCoin = new BigDecimal(0);
|
||||||
|
BigDecimal userBalanceJf = new BigDecimal(0);
|
||||||
PreparedStatement oidStatements = fzdsconn.prepareStatement("select * from user_copy1 where del_flag = 0 and yljk_oid = '"+map.get("oid")+"' ");
|
PreparedStatement oidStatements = fzdsconn.prepareStatement("select * from user_copy1 where del_flag = 0 and yljk_oid = '"+map.get("oid")+"' ");
|
||||||
ResultSet oidResultSet = oidStatements.executeQuery();
|
ResultSet oidResultSet = oidStatements.executeQuery();
|
||||||
|
userBalanceCoin = oidResultSet.getBigDecimal("peanut_coin").add(new BigDecimal(map.get("point").toString()));
|
||||||
|
userBalanceJf = oidResultSet.getBigDecimal("jf").add(new BigDecimal(map.get("pointByJF").toString()));
|
||||||
//已绑定过id
|
//已绑定过id
|
||||||
if (oidResultSet.next()){
|
if (oidResultSet.next()){
|
||||||
String sql = "update user_copy1 set " +
|
String sql = "update user_copy1 set " +
|
||||||
@@ -385,7 +388,6 @@ public class DataMigrationUtil extends Thread {
|
|||||||
"vip= "+map.get("payStatus")+" ,peanut_coin = peanut_coin + "+map.get("point")+" , jf = jf + "+map.get("pointByJF")+" where id = "+oidResultSet.getString("id")+"";
|
"vip= "+map.get("payStatus")+" ,peanut_coin = peanut_coin + "+map.get("point")+" , jf = jf + "+map.get("pointByJF")+" where id = "+oidResultSet.getString("id")+"";
|
||||||
PreparedStatement oidUpdateStatement = fzdsconn.prepareStatement(sql);
|
PreparedStatement oidUpdateStatement = fzdsconn.prepareStatement(sql);
|
||||||
userId = oidResultSet.getString("id");
|
userId = oidResultSet.getString("id");
|
||||||
userBalance = oidResultSet.getBigDecimal("peanut_coin").add(new BigDecimal(map.get("point").toString()));
|
|
||||||
oidUpdateStatement.execute();
|
oidUpdateStatement.execute();
|
||||||
oidUpdateStatement.close();
|
oidUpdateStatement.close();
|
||||||
}else {
|
}else {
|
||||||
@@ -401,7 +403,6 @@ public class DataMigrationUtil extends Thread {
|
|||||||
"vip= "+map.get("payStatus")+" ,peanut_coin = peanut_coin + "+map.get("point")+" , jf = jf + "+map.get("pointByJF")+" where tel = '"+map.get("cellPhone")+"'";
|
"vip= "+map.get("payStatus")+" ,peanut_coin = peanut_coin + "+map.get("point")+" , jf = jf + "+map.get("pointByJF")+" where tel = '"+map.get("cellPhone")+"'";
|
||||||
PreparedStatement telUpdateStatement = fzdsconn.prepareStatement(sql);
|
PreparedStatement telUpdateStatement = fzdsconn.prepareStatement(sql);
|
||||||
userId = telResultSet.getString("id");
|
userId = telResultSet.getString("id");
|
||||||
userBalance = oidResultSet.getBigDecimal("peanut_coin").add(new BigDecimal(map.get("point").toString()));
|
|
||||||
telUpdateStatement.execute();
|
telUpdateStatement.execute();
|
||||||
telUpdateStatement.close();
|
telUpdateStatement.close();
|
||||||
}
|
}
|
||||||
@@ -425,13 +426,14 @@ public class DataMigrationUtil extends Thread {
|
|||||||
userId = id.toString();
|
userId = id.toString();
|
||||||
}
|
}
|
||||||
telInsertStatement.close();
|
telInsertStatement.close();
|
||||||
userBalance = new BigDecimal(map.get("point").toString());
|
userBalanceCoin = new BigDecimal(map.get("point").toString());
|
||||||
|
userBalanceJf = new BigDecimal(map.get("pointByJF").toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//添加超v
|
//添加超v
|
||||||
PreparedStatement userVipStatement = fzdsconn.prepareStatement(
|
|
||||||
"INSERT ignore INTO user_vip_copy1 (user_id,type,start_time,end_time,state) VALUES (?, ?, ?, ?, ?)");
|
|
||||||
if (map.get("paydate")!=null&&map.get("payValidDate")!=null){
|
if (map.get("paydate")!=null&&map.get("payValidDate")!=null){
|
||||||
|
PreparedStatement userVipStatement = fzdsconn.prepareStatement(
|
||||||
|
"INSERT ignore INTO user_vip_copy1 (user_id,type,start_time,end_time,state) VALUES (?, ?, ?, ?, ?)");
|
||||||
userVipStatement.setString(1,userId);
|
userVipStatement.setString(1,userId);
|
||||||
userVipStatement.setString(2,map.get("payStatus").toString());
|
userVipStatement.setString(2,map.get("payStatus").toString());
|
||||||
userVipStatement.setString(3,map.get("paydate").toString());
|
userVipStatement.setString(3,map.get("paydate").toString());
|
||||||
@@ -444,21 +446,34 @@ public class DataMigrationUtil extends Thread {
|
|||||||
userVipStatement.execute();
|
userVipStatement.execute();
|
||||||
userVipStatement.close();
|
userVipStatement.close();
|
||||||
}
|
}
|
||||||
//添加灵兰币记录
|
|
||||||
PreparedStatement transactionDetailStatement = fzdsconn.prepareStatement(
|
|
||||||
"INSERT ignore INTO transaction_details_copy1 (user_id,order_type,change_amount,remark,user_balance," +
|
|
||||||
"user_name,tel) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
|
||||||
if (map.get("point")!=null&&!"0".equals(map.get("point").toString())){
|
if (map.get("point")!=null&&!"0".equals(map.get("point").toString())){
|
||||||
|
//添加虚拟币记录
|
||||||
|
PreparedStatement transactionDetailStatement = fzdsconn.prepareStatement(
|
||||||
|
"INSERT ignore INTO transaction_details_copy1 (user_id,order_type,change_amount,remark,user_balance," +
|
||||||
|
"user_name,tel) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
||||||
transactionDetailStatement.setString(1,userId);
|
transactionDetailStatement.setString(1,userId);
|
||||||
transactionDetailStatement.setString(2,"系统合并结算");
|
transactionDetailStatement.setString(2,"系统合并结算");
|
||||||
transactionDetailStatement.setString(3,map.get("point").toString());
|
transactionDetailStatement.setString(3,map.get("point").toString());
|
||||||
transactionDetailStatement.setString(4,"合并");
|
transactionDetailStatement.setString(4,"合并");
|
||||||
transactionDetailStatement.setBigDecimal(5,userBalance);
|
transactionDetailStatement.setBigDecimal(5,userBalanceCoin);
|
||||||
transactionDetailStatement.setString(6,map.get("nameCN")==null?"":map.get("nameCN").toString());
|
transactionDetailStatement.setString(6,map.get("nameCN")==null?"":map.get("nameCN").toString());
|
||||||
transactionDetailStatement.setString(7,map.get("cellPhone").toString());
|
transactionDetailStatement.setString(7,map.get("cellPhone").toString());
|
||||||
transactionDetailStatement.execute();
|
transactionDetailStatement.execute();
|
||||||
transactionDetailStatement.close();
|
transactionDetailStatement.close();
|
||||||
}
|
}
|
||||||
|
if (map.get("pointByJF")!=null&&!"0".equals(map.get("pointByJF").toString())){
|
||||||
|
//添加积分记录
|
||||||
|
PreparedStatement jfTransactionDetailStatement = fzdsconn.prepareStatement(
|
||||||
|
"INSERT ignore INTO jf_transaction_details_copy1 (user_id,act_type,change_amount,user_balance,remark) " +
|
||||||
|
"VALUES (?, ?, ?, ?, ?)");
|
||||||
|
jfTransactionDetailStatement.setString(1,userId);
|
||||||
|
jfTransactionDetailStatement.setString(2,"0");
|
||||||
|
jfTransactionDetailStatement.setString(3,map.get("pointByJF").toString());
|
||||||
|
jfTransactionDetailStatement.setBigDecimal(4,userBalanceJf);
|
||||||
|
jfTransactionDetailStatement.setString(5,"系统合并结算");
|
||||||
|
jfTransactionDetailStatement.execute();
|
||||||
|
jfTransactionDetailStatement.close();
|
||||||
|
}
|
||||||
}catch (Exception ee){
|
}catch (Exception ee){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class UserAddressController {
|
|||||||
/**
|
/**
|
||||||
* 删除用户地址
|
* 删除用户地址
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/delete", method = RequestMethod.GET)
|
@RequestMapping(value = "/delete")
|
||||||
public R delete(@RequestParam("id") Integer id) {
|
public R delete(@RequestParam("id") Integer id) {
|
||||||
userAddressService.removeById(id);
|
userAddressService.removeById(id);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.common.dao;
|
||||||
|
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.peanut.modules.common.entity.JfTransactionDetails;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface JfTransactionDetailsDao extends MPJBaseMapper<JfTransactionDetails> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.peanut.modules.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("jf_transaction_details")
|
||||||
|
public class JfTransactionDetails implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId
|
||||||
|
private Integer id;
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Integer userId;
|
||||||
|
/**
|
||||||
|
* 0增加1减少
|
||||||
|
*/
|
||||||
|
private String actType;
|
||||||
|
/**
|
||||||
|
* 变动金额
|
||||||
|
*/
|
||||||
|
private BigDecimal changeAmount;
|
||||||
|
/**
|
||||||
|
* 余额
|
||||||
|
*/
|
||||||
|
private BigDecimal userBalance;
|
||||||
|
/**
|
||||||
|
* 关联id
|
||||||
|
*/
|
||||||
|
private Integer relationId;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@TableLogic
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.peanut.modules.common.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.peanut.modules.common.entity.JfTransactionDetails;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public interface JfTransactionDetailsService extends IService<JfTransactionDetails> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.peanut.modules.common.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.modules.common.dao.JfTransactionDetailsDao;
|
||||||
|
import com.peanut.modules.common.entity.JfTransactionDetails;
|
||||||
|
import com.peanut.modules.common.service.JfTransactionDetailsService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service("commonJfTransactionDetailsService")
|
||||||
|
public class JfTransactionDetailsServiceImpl extends ServiceImpl<JfTransactionDetailsDao, JfTransactionDetails> implements JfTransactionDetailsService {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user