Commit e4409308 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents d2082ec5 99da74fb
......@@ -24,6 +24,7 @@
</build>
<properties>
<mapper.version>3.4.0</mapper.version>
<poi.version>3.15</poi.version>
</properties>
<dependencies>
......@@ -125,6 +126,50 @@
<scope>compile</scope>
</dependency>
<!-- excel 组件 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>${poi.version}</version>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>stax</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.6.0</version>
<exclusions>
<exclusion>
<artifactId>stax-api</artifactId>
<groupId>stax</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
......
......@@ -16,9 +16,6 @@ public class ObjectRestResponse<T> extends BaseResponse {
private static final Integer WEB_CALL_RESULT_FAILED = ResultCode.FAILED_CODE;
private static final String RESULT_SUCCESS_MSG = "操作成功";
private static final String RESULT_FAIL_MSG = "操作失败";
private static final String PARAM_IS_EMPTY = "参数为空";
public boolean isRel() {
return rel;
}
......
......@@ -14,6 +14,13 @@ public class UUIDUtils {
"W", "X", "Y", "Z" };
public static String[] chars1 = new String[] { "a", "b", "c", "d", "e", "f",
"g", "h", "i", "j", "k", "l", "m", "n", "p", "q", "r", "s",
"t", "u", "v", "w", "x", "y", "z", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I",
"J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "U", "V",
"W", "X", "Y", "Z" };
public static String generateShortUuid() {
StringBuffer shortBuffer = new StringBuffer();
String uuid = UUID.randomUUID().toString().replace("-", "");
......@@ -25,4 +32,16 @@ public class UUIDUtils {
return shortBuffer.toString();
}
public static String genCodes(int length) {
StringBuffer shortBuffer = new StringBuffer();
String uuid = UUID.randomUUID().toString().replace("-", "");
for (int i = 0; i < length; i++) {
String str = uuid.substring(i * 4, i * 4 + 4);
int x = Integer.parseInt(str, 16);
shortBuffer.append(chars1[x % 0x3E]);
}
return shortBuffer.toString();
}
}
package com.github.wxiaoqi.security.common.util.excel;
import org.apache.poi.hssf.eventusermodel.*;
import org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder.SheetRecordCollectingListener;
import org.apache.poi.hssf.eventusermodel.dummyrecord.LastCellOfRowDummyRecord;
import org.apache.poi.hssf.eventusermodel.dummyrecord.MissingCellDummyRecord;
import org.apache.poi.hssf.model.HSSFFormulaParser;
import org.apache.poi.hssf.record.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Excel2003格式解析
*
* @author lipengjun
* @email 939961241@qq.com
* @date 2017年10月28日 13:11:27
*/
public class Excel2003Reader implements HSSFListener {
private int minColumns = -1;
private POIFSFileSystem fs;
/**
* 最后一行行号
*/
private int lastRowNumber;
/**
* 最后一列列号
*/
private int lastColumnNumber;
/**
* Should we output the formula, or the value it has?
*/
private boolean outputFormulaValues = true;
/**
* For parsing Formulas
*/
private SheetRecordCollectingListener workbookBuildingListener;
// 工作薄
private HSSFWorkbook stubWorkbook;
// Records we pick up as we process
private SSTRecord sstRecord;
private FormatTrackingHSSFListener formatListener;
// 表索引
private int sheetIndex = -1;
private BoundSheetRecord[] orderedBSRs;
@SuppressWarnings("rawtypes")
private ArrayList boundSheetRecords = new ArrayList();
// For handling formulas with string results
private int nextRow;
private int nextColumn;
private boolean outputNextStringRecord;
// 存储行记录的容器
private List<String> rowlist = new ArrayList<String>();
;
// 单Sheet数据
private List<String[]> sheetData = new ArrayList<String[]>();
// 多Sheet数据
private Map<Integer, List<String[]>> workData = new HashMap<Integer, List<String[]>>();
/**
* 遍历excel下所有的sheet
*
* @param fileStream 处理文件流
* @throws IOException 抛出IO异常
*/
public void process(InputStream fileStream)
throws IOException {
this.fs = new POIFSFileSystem(fileStream);
MissingRecordAwareHSSFListener listener = new MissingRecordAwareHSSFListener(
this);
formatListener = new FormatTrackingHSSFListener(listener);
HSSFEventFactory factory = new HSSFEventFactory();
HSSFRequest request = new HSSFRequest();
if (outputFormulaValues) {
request.addListenerForAllRecords(formatListener);
} else {
workbookBuildingListener = new SheetRecordCollectingListener(
formatListener);
request.addListenerForAllRecords(workbookBuildingListener);
}
factory.processWorkbookEvents(request, fs);
}
/**
* HSSFListener 监听方法,处理 Record
*
* @param record 行记录
*/
@SuppressWarnings("unchecked")
@Override
public void processRecord(Record record) {
int thisRow = -1;
int thisColumn = -1;
String thisStr = null;
String value = null;
switch (record.getSid()) {
case BoundSheetRecord.sid:
boundSheetRecords.add(record);
break;
case BOFRecord.sid:
BOFRecord br = (BOFRecord) record;
if (br.getType() == BOFRecord.TYPE_WORKSHEET) {
// 如果有需要,则建立子工作薄
if (workbookBuildingListener != null && stubWorkbook == null) {
stubWorkbook = workbookBuildingListener.getStubHSSFWorkbook();
}
if (sheetIndex >= 0) {
List<String[]> data = new ArrayList<String[]>();
data.addAll(sheetData);
workData.put(sheetIndex, data);
sheetData.clear();
}
sheetIndex++;
if (orderedBSRs == null) {
orderedBSRs = BoundSheetRecord.orderByBofPosition(boundSheetRecords);
}
}
break;
case SSTRecord.sid:
sstRecord = (SSTRecord) record;
break;
case BlankRecord.sid:
BlankRecord brec = (BlankRecord) record;
thisRow = brec.getRow();
thisColumn = brec.getColumn();
thisStr = "";
rowlist.add(thisColumn, thisStr);
break;
case BoolErrRecord.sid: // 单元格为布尔类型
BoolErrRecord berec = (BoolErrRecord) record;
thisRow = berec.getRow();
thisColumn = berec.getColumn();
thisStr = berec.getBooleanValue() + "";
rowlist.add(thisColumn, thisStr);
break;
case FormulaRecord.sid: // 单元格为公式类型
FormulaRecord frec = (FormulaRecord) record;
thisRow = frec.getRow();
thisColumn = frec.getColumn();
if (outputFormulaValues) {
if (Double.isNaN(frec.getValue())) {
// Formula result is a string
// This is stored in the next record
outputNextStringRecord = true;
nextRow = frec.getRow();
nextColumn = frec.getColumn();
} else {
thisStr = formatListener.formatNumberDateCell(frec);
}
} else {
thisStr = '"' + HSSFFormulaParser.toFormulaString(
stubWorkbook, frec.getParsedExpression()) + '"';
}
rowlist.add(thisColumn, thisStr);
break;
case StringRecord.sid:// 单元格中公式的字符串
if (outputNextStringRecord) {
// String for formula
StringRecord srec = (StringRecord) record;
thisStr = srec.getString();
thisRow = nextRow;
thisColumn = nextColumn;
outputNextStringRecord = false;
}
break;
case LabelRecord.sid:
LabelRecord lrec = (LabelRecord) record;
thisColumn = lrec.getColumn();
value = lrec.getValue().trim();
value = value.equals("") ? " " : value;
this.rowlist.add(thisColumn, value);
break;
case LabelSSTRecord.sid: // 单元格为字符串类型
LabelSSTRecord lsrec = (LabelSSTRecord) record;
thisColumn = lsrec.getColumn();
if (sstRecord == null) {
rowlist.add(thisColumn, " ");
} else {
value = sstRecord.getString(lsrec.getSSTIndex()).toString().trim();
value = value.equals("") ? " " : value;
rowlist.add(thisColumn, value);
}
break;
case NumberRecord.sid: // 单元格为数字类型
NumberRecord numrec = (NumberRecord) record;
thisColumn = numrec.getColumn();
value = formatListener.formatNumberDateCell(numrec).trim();
value = value.equals("") ? " " : value;
// 向容器加入列值
rowlist.add(thisColumn, value);
break;
default:
break;
}
// 遇到新行的操作
if (thisRow != -1 && thisRow != lastRowNumber) {
lastColumnNumber = -1;
}
// 空值的操作
if (record instanceof MissingCellDummyRecord) {
MissingCellDummyRecord mc = (MissingCellDummyRecord) record;
thisColumn = mc.getColumn();
rowlist.add(thisColumn, "");
}
// 更新行和列的值
if (thisRow > -1) {
lastRowNumber = thisRow;
}
if (thisColumn > -1) {
lastColumnNumber = thisColumn;
}
// 行结束时的操作
if (record instanceof LastCellOfRowDummyRecord) {
if (minColumns > 0) {
// 列值重新置空
if (lastColumnNumber == -1) {
lastColumnNumber = 0;
}
}
lastColumnNumber = -1;
// 每行结束时, 数据写入集合
sheetData.add(rowlist.toArray(new String[]{}));
// 清空容器
rowlist.clear();
}
}
/**
* 获取数据(单Sheet)
*
* @param sheetIndex sheet下标
* @return List<String[]> 数据
*/
public List<String[]> getSheetData(Integer sheetIndex) {
return workData.get(sheetIndex);
}
/**
* 获取数据(多Sheet)
*
* @return Map<Integer, List<String[]>> 多sheet的数据
*/
public Map<Integer, List<String[]>> getSheetData() {
return workData;
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.common.util.excel;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* Excel文件导入的基本功能类
* 可导入EXCEL2003 和 EXCEL2007格式。
*
* @author lipengjun
* @email 939961241@qq.com
* @date 2017年10月28日 13:11:27
*/
public class ExcelImport {
/**
* excel2003扩展名
*/
public static final String EXCEL03_EXTENSION = ".xls";
/**
* excel2007扩展名
*/
public static final String EXCEL07_EXTENSION = ".xlsx";
private ExcelImport() {
}
/**
* 解析EXCEL数据为 List<String[]>
*
* @param excelFile 要解析的上传EXCEL文件
* @return List<String[]) 行(列)
*/
public static List<String[]> getExcelData07(MultipartFile excelFile) {
List<String[]> resultList = null;
if (null == excelFile || excelFile.isEmpty()) {
throw new RuntimeException("文件内容为空!");
}
Excel2007Reader excel07 = new Excel2007Reader();
try {
excel07.process(excelFile.getInputStream(), false);
} catch (Exception e) {
throw new RuntimeException("excel解析失败!");
}
resultList = excel07.getSheetData(0);
return resultList;
}
/**
* 解析EXCEL数据为 List<String[]>
*
* @param excelFile 要解析的上传EXCEL文件
* @return List<String[]) 行(列)
*/
public static List<String[]> getExcelData03(MultipartFile excelFile) {
List<String[]> resultList = null;
if (null == excelFile || excelFile.isEmpty()) {
throw new RuntimeException("文件内容为空!");
}
Excel2003Reader excel03 = new Excel2003Reader();// 实例化excel处理对象
try {
excel03.process(excelFile.getInputStream());
} catch (IOException e) {
throw new RuntimeException("excel解析失败!");
}
resultList = excel03.getSheetData(0);
return resultList;
}
/**
* 通过解析MultipartFile对象获取excel内容,并且将其拼装为List<String[]>对象返回
*
* @param excelFile
* @return
* @throws Exception
*/
public static List<String[]> getExcelData(MultipartFile excelFile)
throws RuntimeException {
List<String[]> resultList = null;
if (!excelFile.isEmpty()) {// 上传的文件不能为空
String excelFileName = excelFile.getOriginalFilename();// 文件名(带后缀)
if (excelFileName.toLowerCase().endsWith(EXCEL03_EXTENSION)) {// 如果文件是以.xls为后缀
Excel2003Reader excel03 = new Excel2003Reader();// 实例化excel处理对象
try {
excel03.process(excelFile.getInputStream());
} catch (IOException e) {
throw new RuntimeException("excel解析失败!");
}
resultList = excel03.getSheetData(0);
} else if (excelFileName.toLowerCase().endsWith(EXCEL07_EXTENSION)) {// 如果文件是以.xlsx为后缀
Excel2007Reader excel07 = new Excel2007Reader();
try {
excel07.process(excelFile.getInputStream(), false);
} catch (Exception e) {
throw new RuntimeException("excel解析失败!");
}
resultList = excel07.getSheetData(0);
}
}
return resultList;
}
/**
* 通过解析MultipartFile对象获取excel内容,并且将其拼装为Map<Integer, List<String[]>>对象返回
*
* @param excelFile
* @return
* @throws Exception
*/
public static Map<Integer, List<String[]>> getExcelDataAll(MultipartFile excelFile)
throws RuntimeException {
Map<Integer, List<String[]>> result = null;
if (!excelFile.isEmpty()) {// 上传的文件不能为空
String excelFileName = excelFile.getOriginalFilename();// 文件名(带后缀)
if (excelFileName.toLowerCase().endsWith(EXCEL03_EXTENSION)) {// 如果文件是以.xls为后缀
Excel2003Reader excel03 = new Excel2003Reader();// 实例化excel处理对象
try {
excel03.process(excelFile.getInputStream());
} catch (IOException e) {
throw new RuntimeException("excel解析失败!");
}
result = excel03.getSheetData();
} else if (excelFileName.toLowerCase().endsWith(EXCEL07_EXTENSION)) {// 如果文件是以.xlsx为后缀
Excel2007Reader excel07 = new Excel2007Reader();
try {
excel07.process(excelFile.getInputStream(), true);
} catch (Exception e) {
throw new RuntimeException("excel解析失败!");
}
result = excel07.getSheetData();
}
}
return result;
}
}
package com.github.wxiaoqi.security.common.util.excel;
/**
* XSSFDataType
*
* @author lipengjun
* @email 939961241@qq.com
* @date 2017年10月28日 13:11:27
*/
public enum XssfDataType {
BOOL, ERROR, FORMULA, INLINESTR, SSTINDEX, NUMBER, DATE, DATETIME, TIME,
}
......@@ -13,10 +13,10 @@ USER_HEADER_URL_DEFAULT=https://xxtest.upyuns.com/image/app/default_%20avatar.pn
#默认昵称
USER_NIKENAME_DEFAULT=XX_
#短信机
ACCESSKEYID=LTAIlXrgxOBAj2Ny
ACCESSKEYSECRET=zo8OkOCF4iygqOjYYoxRKfVRxDvgTI
TEMPLATECODE=SMS_166480010
SIGNNAME=升云
ACCESSKEYID=LTAInxMDwHQL8yg9
ACCESSKEYSECRET=OCKDEiwKGjePCZgPeWMEUFGwGbKYLA
TEMPLATECODE=SMS_170070101
SIGNNAME=滴房车
#微信支付配置
WINXIN_AppID=wxcc2c9b7c87439a6d
WINXIN_AppSecret=279796e8c2963c8a5ddc8270ef642b29
......
package com.github.wxiaoqi.security.admin.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
......@@ -31,6 +32,7 @@ public class AppUserDetail {
private Long createtime;
private Long updatetime;
private Integer isdel;
//渠道来源;1-app;2-小程序
private Integer channel;
/**
* 省份编号
......@@ -54,4 +56,22 @@ public class AppUserDetail {
*/
@Column(name = "upd_host")
private String updHost;
@ApiModelProperty(value = "用户职位")
@Column(name = "position_id")
private Integer positionId;
@ApiModelProperty(value = "用户来源:0-自来,1-用户邀请")
@Column(name = "source")
private Integer source;
@ApiModelProperty(value = "邀请码")
@Column(name = "code")
private String code;
@ApiModelProperty(value = "邀请人id:")
@Column(name = "inviter_account")
private String inviterAccount;
}
package com.github.wxiaoqi.security.admin.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import javax.persistence.*;
/**
......@@ -11,6 +14,7 @@ import javax.persistence.*;
* @email 463540703@qq.com
* @date 2019-06-04 14:29:29
*/
@Data
@Table(name = "base_user_relation")
public class BaseUserRelation implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -42,90 +46,5 @@ public class BaseUserRelation implements Serializable {
//是否删除;0-正常;1-删除
@Column(name = "is_del")
private Integer isDel;
/**
* 设置:主键id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:主键id
*/
public Integer getId() {
return id;
}
/**
* 设置:用户id
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* 获取:用户id
*/
public Integer getUserId() {
return userId;
}
/**
* 设置:小程序用户id
*/
public void setToUid(Integer toUid) {
this.toUid = toUid;
}
/**
* 获取:小程序用户id
*/
public Integer getToUid() {
return toUid;
}
/**
* 设置:是否有效;0-有效;1-无效
*/
public void setStaus(Integer staus) {
this.staus = staus;
}
/**
* 获取:是否有效;0-有效;1-无效
*/
public Integer getStaus() {
return staus;
}
/**
* 设置:创建时间
*/
public void setCrtTime(Long crtTime) {
this.crtTime = crtTime;
}
/**
* 获取:创建时间
*/
public Long getCrtTime() {
return crtTime;
}
/**
* 设置:更新时间
*/
public void setUpdTime(Long updTime) {
this.updTime = updTime;
}
/**
* 获取:更新时间
*/
public Long getUpdTime() {
return updTime;
}
/**
* 设置:是否删除;0-正常;1-删除
*/
public void setIsDel(Integer isDel) {
this.isDel = isDel;
}
/**
* 获取:是否删除;0-正常;1-删除
*/
public Integer getIsDel() {
return isDel;
}
}
package com.github.wxiaoqi.security.admin.feign;
import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.admin.feign.dto.UserDTO;
......@@ -99,5 +100,7 @@ public interface UserFeign {
@GetMapping("/member/entityList")
public ObjectRestResponse<List<BaseUserMemberLevel>> memberEntityList(@RequestParam("entity") Map<String, Object> entity);
@GetMapping("/app/user/one")
public AppUserLogin one(@RequestParam(value = "username")String username);
}
package com.github.wxiaoqi.security.admin.feign.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -20,6 +21,40 @@ public class AppUserDTO {
private String birthday;
private String personSign;
private String remark;
//渠道来源;1-app;2-小程序
private Integer channel;
/**
* 省份编号
*/
private Integer provinceCode;
/**
* 市编号
*/
private Integer cityCode;
/**
* 创建ip
*/
private String crtHost;
/**
* 更新ip
*/
private String updHost;
@ApiModelProperty(value = "用户职位")
private Integer positionId;
@ApiModelProperty(value = "用户来源:0-自来,1-用户邀请")
private Integer source;
@ApiModelProperty(value = "邀请码")
private String code;
@ApiModelProperty(value = "邀请人id:")
private String inviterAccount;
private Integer imUserid;
private String wxOpenid;
private String unionid;
......
......@@ -54,15 +54,16 @@ public class AppUserManageVo {
/**
* 邀请人id
*/
@Column(name = "Inviter_account")
private Integer InviterAccount;
@Column(name = "inviter_account")
private Integer inviterAccount;
/**
* 账号申请所在地
*
*/
@Column(name = "address")
private String address;
@Column(name = "province_code")
private String provinceCode;
@Column(name = "city_code")
private String cityCode;
/**
* 用户性别
*/
......
package com.github.wxiaoqi.security.admin.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -46,5 +47,39 @@ public class AppUserVo {
private String personSign;
//备注
private String remark;
//渠道来源;1-app;2-小程序
private Integer channel;
/**
* 省份编号
*/
private Integer provinceCode;
/**
* 市编号
*/
private Integer cityCode;
/**
* 创建ip
*/
private String crtHost;
/**
* 更新ip
*/
private String updHost;
@ApiModelProperty(value = "用户职位")
private Integer positionId;
@ApiModelProperty(value = "用户来源:0-自来,1-用户邀请")
private Integer source;
@ApiModelProperty(value = "邀请码")
private String code;
@ApiModelProperty(value = "邀请人id:")
private String inviterAccount;
}
......@@ -68,7 +68,7 @@ public class AppUserDetailBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
BeanUtils.copyProperties(entity,userVo);
if(entity!=null){
entity.setUpdHost(AppPermissionService.getIp());
entity.setUpdatetime(Instant.now().toEpochMilli());
entity.setUpdatetime(Instant.now().toEpochMilli()/1000L);
super.updateSelectiveById(entity);
}
} catch (Exception e) {
......
......@@ -3,14 +3,11 @@ package com.github.wxiaoqi.security.admin.rest;
import com.ace.cache.annotation.Cache;
import com.github.wxiaoqi.security.admin.biz.AppUserBiz;
import com.github.wxiaoqi.security.admin.biz.AppUserDetailBiz;
import com.github.wxiaoqi.security.admin.biz.AppUserLoginBiz;
import com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz;
import com.github.wxiaoqi.security.admin.entity.AppUser;
import com.github.wxiaoqi.security.admin.entity.AppUserDetail;
import com.github.wxiaoqi.security.admin.entity.Group;
import com.github.wxiaoqi.security.admin.entity.User;
import com.github.wxiaoqi.security.admin.entity.*;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.admin.vo.AppUserGroups;
import com.github.wxiaoqi.security.admin.vo.AppUserInfoVo;
import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.admin.vo.UserMemberVo;
import com.github.wxiaoqi.security.auth.client.config.UserAuthConfig;
......@@ -24,8 +21,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -49,6 +44,9 @@ public class AppUserController extends CommonBaseController {
@Autowired
AppUserDetailBiz userDetailBiz;
@Autowired
AppUserLoginBiz appUserLoginBiz;
@Autowired
private BaseUserMemberBiz userMemberBiz;
......@@ -146,5 +144,16 @@ public class AppUserController extends CommonBaseController {
return ObjectRestResponse.succ();
}
/**
* 更新用户信息
* @param username
* @return
*/
@GetMapping("/one")
public AppUserLogin one(@RequestParam(value = "username")String username){
return appUserLoginBiz.getUserByUsername(username);
}
}
......@@ -15,11 +15,12 @@ import com.github.wxiaoqi.security.api.vo.user.AppUserInfo;
import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.EmojiFilter;
import com.github.wxiaoqi.security.common.util.UUIDUtils;
import com.github.wxiaoqi.security.common.util.VerificationUtils;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.xxfc.platform.activity.Feign.ActivityFeign;
import com.xxfc.platform.activity.feign.ActivityFeign;
import com.xxfc.platform.im.feign.ImFeign;
import com.xxfc.platform.universal.dto.RegionDTO;
import com.xxfc.platform.universal.feign.RegionFeign;
......@@ -248,6 +249,8 @@ public class AppPermissionService {
rsUserDetail.setIsdel(0);
rsUserDetail.setCrtHost(getIp());
setCreateIPInfo(rsUserDetail);
//生成邀请码
rsUserDetail.setCode(UUIDUtils.genCodes(6));
appUserDetailBiz.insertSelective(rsUserDetail);
log.error("注册:新增用户详情: " + userid);
//自动登录获取优惠卷
......@@ -754,6 +757,8 @@ public class AppPermissionService {
rsUserDetail.setCreatetime(now);
rsUserDetail.setUpdatetime(now);
rsUserDetail.setIsdel(0);
//生成邀请码
rsUserDetail.setCode(UUIDUtils.genCodes(6));
//设置来源
rsUserDetail.setChannel(UserSourceEnum.APPLET.getCode());
rsUserDetail.setCrtHost(getIp());
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.github.wxiaoqi.security.admin.mapper.AppUserDetailMapper">
<resultMap id="AppUserVoMap" type="com.github.wxiaoqi.security.admin.vo.AppUserVo">
<result column="id" property="id" />
<result column="userid" property="userid" />
<result column="im_userid" property="imUserid" />
<result column="username" property="username" />
<result column="wx_openid" property="wxOpenid" />
<result column="unionid" property="unionid" />
<result column="openid" property="openid" />
<result column="status" property="status" />
<result column="id_number" property="idNumber" />
<result column="certification_status" property="certificationStatus" />
<result column="is_member" property="isMember" />
<result column="nickname" property="nickname" />
<result column="realname" property="realname" />
<result column="headimgurl" property="headimgurl" />
<result column="birthday" property="birthday" />
<result column="email" property="email" />
<result column="sex" property="sex" />
<result column="person_sign" property="personSign" />
<result column="remark" property="remark" />
</resultMap>
<resultMap id="AppUserVoMap" type="com.github.wxiaoqi.security.admin.vo.AppUserVo">
<result column="id" property="id"/>
<result column="userid" property="userid"/>
<result column="im_userid" property="imUserid"/>
<result column="username" property="username"/>
<result column="wx_openid" property="wxOpenid"/>
<result column="unionid" property="unionid"/>
<result column="openid" property="openid"/>
<result column="status" property="status"/>
<result column="id_number" property="idNumber"/>
<result column="certification_status" property="certificationStatus"/>
<result column="is_member" property="isMember"/>
<result column="nickname" property="nickname"/>
<result column="realname" property="realname"/>
<result column="headimgurl" property="headimgurl"/>
<result column="birthday" property="birthday"/>
<result column="email" property="email"/>
<result column="sex" property="sex"/>
<result column="person_sign" property="personSign"/>
<result column="remark" property="remark"/>
<result column="channel" property="channel"/>
<result column="province_code" property="provinceCode"/>
<result column="city_code" property="cityCode"/>
<result column="crt_host" property="crtHost"/>
<result column="upd_host" property="updHost"/>
<result column="position_id" property="positionId"/>
<result column="source" property="source"/>
<result column="code" property="code"/>
<result column="invitera_ccount" property="inviterAccount"/>
</resultMap>
<!-- 获取用户信息 -->
<select id="getUserInfo" resultMap="AppUserVoMap">
<!-- 获取用户信息 -->
<select id="getUserInfo" resultMap="AppUserVoMap">
select l.im_userid,l.username,l.wx_openid,l.unionid,l.openid,l.status,l.id_number,l.certification_status,d.* from app_user_login l
left join app_user_detail d
on d.userid = l.id
......@@ -43,7 +52,8 @@
d.nickname,
d.source,
d.Inviter_account,
d.address,
d.province_code,
d.city_code,
d.sex,
d.email,
l.username,
......@@ -75,7 +85,7 @@
base_user_member_level ml
on
ml.id = b.member_level
) m
) m
on
l.id = m.user_id
where 1=1
......@@ -97,7 +107,7 @@
</if>
</select>
</select>
</mapper>
\ No newline at end of file
package com.xxfc.platform.activity.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
@Table(name = "integral_rule")
@Data
public class IntegralRule{
/**
* 主键id
*/
@Id
private Integer id;
/**
* 周期单位:0-天,1-周;3-月;4-季;5-年
*/
private Integer period;
/**
* 次数
*/
private Integer number;
/**
* 积分
*/
private Integer point;
/**
* 积分兑换:金额/分
*/
private BigDecimal price;
/**
* 是否连续:0-不连续;1-连续
*/
@Column(name = "is_continuity")
private Boolean isContinuity;
/**
* 多少天后连续算
*/
@Column(name = "finish_day")
private Integer finishDay;
/**
* n天获取的积分
*/
@Column(name = "finish_point")
private Integer finishPoint;
/**
* 是否启用:1-启用;0-停用
*/
private Boolean status;
/**
* 创建时间
*/
@Column(name = "crt_time")
private Long crtTime;
/**
* 是否删除:0-正常;1-删除
*/
private Boolean isdel;
/**
* 规则开始时间
*/
@Column(name = "start_time")
private Long startTime;
/**
* 规则结束时间
*/
@Column(name = "end_time")
private Long endTime;
/**
* 更新时间
*/
@Column(name = "upd_time")
private Long updTime;
/**
* 备注
*/
private String remarks;
/**
* 描述
*/
private String desc;
/**
* 规则图片
*/
private String img;
/**
* 排序
*/
@Column(name = "order_id")
private Integer orderId;
/**
* 规则名称
*/
private String name;
/**
* 获取积分规则
*/
private String regulation;
/**
* json字符串 如:[{"day":4,"integeral":8},{"day":4,"integeral":8}]
*/
@Column(name = "other_rule")
private String otherRule;
}
\ No newline at end of file
package com.xxfc.platform.activity.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
@Table(name = "integral_sign_record")
@Data
public class IntegralSignRecord {
/**
* 主键id
*/
@Id
private Integer id;
/**
* 用户id
*/
@Column(name = "user_id")
private Integer userId;
/**
* 连续签到天数
*/
@Column(name = "sign_days")
private Integer signDays;
/**
* 开始时间
*/
@Column(name = "start_time")
private Long startTime;
/**
* 最后签到时间
*/
@Column(name = "last_time")
private Long lastTime;
/**
* 是否删除:0-正常;1-删除
*/
private Boolean isdel;
}
\ No newline at end of file
package com.xxfc.platform.activity.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
@Table(name = "integral_user_record")
@Data
public class IntegralUserRecord {
/**
* 主键id
*/
@Id
private Integer id;
/**
* 用户id
*/
@Column(name = "user_id")
private Integer userId;
/**
* 0-获取积分;1-抵扣积分
*/
private Boolean type;
/**
* 积分数
*/
private Integer point;
/**
* 积分规则id
*/
@Column(name = "integral_rule_id")
private Integer integralRuleId;
/**
* 积分时间
*/
@Column(name = "crt_time")
private Long crtTime;
/**
* 是否有效:1-有效;0-失效
*/
@Column(name = "is_valid")
private Boolean isValid;
/**
* 是否删除:0-正常;1-删除
*/
private Boolean isdel;
/**
* 获取积分的途径id:如订单id,评论id,签到记录id
*/
@Column(name = "channel_id")
private Integer channelId;
}
\ No newline at end of file
package com.xxfc.platform.activity.entity;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
@Table(name = "integral_user_total")
@Data
public class IntegralUserTotal {
/**
* 主键id
*/
@Id
private Integer id;
/**
* 用户id
*/
@Column(name = "user_id")
private Integer userId;
/**
* 总收益积分
*/
@Column(name = "total_point")
private Integer totalPoint;
/**
* 剩余收益积分
*/
@Column(name = "rest_point")
private Integer restPoint;
@Column(name = "crt_time")
private Long crtTime;
@Column(name = "upd_time")
private Long updTime;
/**
* 是否删除:0-正常;1-删除
*/
private Boolean isdel;
}
\ No newline at end of file
package com.xxfc.platform.activity.Feign;
package com.xxfc.platform.activity.feign;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.vo.UserCouponVo;
......
package com.xxfc.platform.activity.user;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
@Slf4j
@Component
public class UserInfoBiz {
@Autowired
UserFeign userFeign;
public AppUserDTO getUserInfo() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
if(request.getHeader("Authorization") !=null) {
return userFeign.userDetailByToken(request.getHeader("Authorization")).getData();
} else if(request.getHeader("access_token") != null) {
return userFeign.userDetailByToken(request.getHeader("access_token")).getData();
}
return null;
}
}
package com.xxfc.platform.activity.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.entity.IntegralRule;
import com.xxfc.platform.activity.mapper.IntegralRuleMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
/**
* 添加、更新积分规则
* @param integralRule
* @return
*/
public ObjectRestResponse add(IntegralRule integralRule) {
if(integralRule == null) {
return ObjectRestResponse.paramIsEmpty();
}
if(integralRule.getId() != null) {//已存在,更新
IntegralRule oldValue = mapper.selectByPrimaryKey(integralRule.getId());
if(oldValue == null) {
return ObjectRestResponse.createDefaultFail();
}
BeanUtil.copyProperties(integralRule, oldValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
mapper.updateByPrimaryKeySelective(oldValue);
return ObjectRestResponse.succ();
}
mapper.insertSelective(integralRule);
return ObjectRestResponse.succ();
}
/**
* 删除积分规则
* @param id
* @return
*/
public ObjectRestResponse deleteOne(Integer id) {
if(id == null || id < 0) {
return ObjectRestResponse.paramIsEmpty();
}
IntegralRule oldValue = mapper.selectByPrimaryKey(id);
if(oldValue == null) {
return ObjectRestResponse.createDefaultFail();
}
oldValue.setIsdel(true);
mapper.updateByPrimaryKeySelective(oldValue);
return ObjectRestResponse.succ();
}
public ObjectRestResponse<IntegralRule> getOne(IntegralRule integralRule) {
if(integralRule == null) {
return ObjectRestResponse.paramIsEmpty();
}
IntegralRule oldValue = mapper.selectByPrimaryKey(integralRule.getId());
if(oldValue == null) {
return ObjectRestResponse.createDefaultFail();
}
return ObjectRestResponse.succ(oldValue);
}
public ObjectRestResponse<List<IntegralRule>> getAll(IntegralRule integralRule) {
List<IntegralRule> integralRules = mapper.selectAllByParam(integralRule);
return ObjectRestResponse.succ(integralRules);
}
}
package com.xxfc.platform.activity.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.activity.entity.IntegralSignRecord;
import com.xxfc.platform.activity.mapper.IntegralSignRecordMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, IntegralSignRecord> {
}
package com.xxfc.platform.activity.biz;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.entity.IntegralUserRecord;
import com.xxfc.platform.activity.mapper.IntegralUserRecordMapper;
import com.xxfc.platform.activity.user.UserInfoBiz;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
@Slf4j
public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, IntegralUserRecord> {
@Autowired
UserInfoBiz userInfoBiz;
/**
* 添加用户积分记录
* @param integralUserRecord
* @return
*/
public ObjectRestResponse add(IntegralUserRecord integralUserRecord) {
return ObjectRestResponse.succ();
}
/**
* 删除一个用户记录
* @param id
* @return
*/
public ObjectRestResponse deleteOne(Integer id) {
if(id == null || id <=0 ) {
return ObjectRestResponse.paramIsEmpty();
}
IntegralUserRecord integralUserRecord = mapper.selectByPrimaryKey(id);
if(integralUserRecord == null) {
log.info("删除的用户记录不存在,要删除的id ={}", id);
return ObjectRestResponse.createDefaultFail();
}
integralUserRecord.setIsdel(true);
mapper.updateByPrimaryKeySelective(integralUserRecord);
return ObjectRestResponse.succ();
}
/**
* 根据获取某个用户的列表
* @return
*/
public ObjectRestResponse<IntegralUserRecord> getUserList() {
AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
}
return ObjectRestResponse.succ();
}
}
package com.xxfc.platform.activity.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.entity.IntegralUserTotal;
import com.xxfc.platform.activity.mapper.IntegralUserTotalMapper;
import com.xxfc.platform.activity.user.UserInfoBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional
public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, IntegralUserTotal> {
@Autowired
UserInfoBiz userInfoBiz;
/**
* 添加用户总积分
* @param integralUserTotal
* @return
*/
public ObjectRestResponse add(IntegralUserTotal integralUserTotal) {
AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
}
if(integralUserTotal == null) {
return ObjectRestResponse.paramIsEmpty();
}
integralUserTotal.setUserId(appUserDTO.getUserid());
if(integralUserTotal.getId() != null) {
IntegralUserTotal oldValue = mapper.selectByPrimaryKey(integralUserTotal.getId());
if(oldValue == null) {
return ObjectRestResponse.createDefaultFail();
}
BeanUtil.copyProperties(integralUserTotal, oldValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
mapper.updateByPrimaryKeySelective(oldValue);
return ObjectRestResponse.succ();
}
mapper.insertSelective(integralUserTotal);
return ObjectRestResponse.succ();
}
/**
* 删除信息
* @param id
* @return
*/
public ObjectRestResponse deleteOne() {
AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
}
IntegralUserTotal integralUserTotal = new IntegralUserTotal();
integralUserTotal.setUserId(appUserDTO.getUserid());
List<IntegralUserTotal> oldValue = mapper.selectAllByParam(integralUserTotal);
if(oldValue == null || oldValue.size() <= 0) {
return ObjectRestResponse.createDefaultFail();
}
oldValue.get(0).setIsdel(true);
mapper.updateByPrimaryKeySelective(oldValue.get(0));
return ObjectRestResponse.succ();
}
/**
* 获取某个用户的积分信息
* @return
*/
public ObjectRestResponse<IntegralUserTotal> getByUser() {
AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
}
IntegralUserTotal integralUserTotal = new IntegralUserTotal();
integralUserTotal.setUserId(appUserDTO.getUserid());
List<IntegralUserTotal> oldValue = mapper.selectAllByParam(integralUserTotal);
if(oldValue == null || oldValue.size() <= 0) {
return ObjectRestResponse.createDefaultFail();
}
return ObjectRestResponse.succ(oldValue.get(0));
}
/**
* 获取所有的信息
* @param integralUserTotal
* @return
*/
public ObjectRestResponse<List<IntegralUserTotal>> getAll(IntegralUserTotal integralUserTotal) {
List<IntegralUserTotal> integralUserTotals = mapper.selectAllByParam(integralUserTotal);
return ObjectRestResponse.succ(integralUserTotals);
}
}
package com.xxfc.platform.activity.mapper;
import com.xxfc.platform.activity.entity.IntegralRule;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface IntegralRuleMapper extends Mapper<IntegralRule> {
public List<IntegralRule> selectAllByParam(IntegralRule integralRule);
}
\ No newline at end of file
package com.xxfc.platform.activity.mapper;
import com.xxfc.platform.activity.entity.IntegralSignRecord;
import tk.mybatis.mapper.common.Mapper;
public interface IntegralSignRecordMapper extends Mapper<IntegralSignRecord> {
}
\ No newline at end of file
package com.xxfc.platform.activity.mapper;
import com.xxfc.platform.activity.entity.IntegralUserRecord;
import tk.mybatis.mapper.common.Mapper;
public interface IntegralUserRecordMapper extends Mapper<IntegralUserRecord> {
}
\ No newline at end of file
package com.xxfc.platform.activity.mapper;
import com.xxfc.platform.activity.entity.IntegralUserTotal;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface IntegralUserTotalMapper extends Mapper<IntegralUserTotal> {
List<IntegralUserTotal> selectAllByParam(IntegralUserTotal integralUserTotal);
}
\ No newline at end of file
package com.xxfc.platform.activity.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.biz.IntegralRuleBiz;
import com.xxfc.platform.activity.entity.IntegralRule;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping(value = "integralRule")
@Api(value = "积分规则")
public class IntegralRuleController {
@Autowired
IntegralRuleBiz integralRuleBiz;
@PostMapping(value = "/add")
@ApiOperation(value = "添加积分规则")
public ObjectRestResponse add(IntegralRule integralRule) {
return integralRuleBiz.add(integralRule);
}
@PostMapping(value = "/delete")
@ApiOperation(value = "删除积分规则")
public ObjectRestResponse deleteOne(Integer id) {
return integralRuleBiz.deleteOne(id);
}
@GetMapping(value = "/one")
@ApiOperation(value = "根据id获取制定规则")
public ObjectRestResponse<IntegralRule> getOne(IntegralRule integralRule) {
return integralRuleBiz.getOne(integralRule);
}
@GetMapping(value = "/list")
@ApiOperation(value = "获取所有的规则")
public ObjectRestResponse<List<IntegralRule>> getList(IntegralRule integralRule) {
return integralRuleBiz.getAll(integralRule);
}
}
package com.xxfc.platform.activity.rest;
import com.xxfc.platform.activity.biz.IntegralSignRecordBiz;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "integralSignRecord")
@Api(value = "用户签到记录")
public class IntegralSignRecordController {
@Autowired
IntegralSignRecordBiz integralSignRecordBiz;
}
package com.xxfc.platform.activity.rest;
import com.xxfc.platform.activity.biz.IntegralUserRecordBiz;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "integralUserRecord")
@Api(value = "用户积分记录")
public class IntegralUserRecordController {
@Autowired
IntegralUserRecordBiz integralUserRecordBiz;
}
package com.xxfc.platform.activity.rest;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "integralUserTotal")
@Api(value = "用户总积分")
public class IntegralUserTotalController {
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.activity.mapper.IntegralRuleMapper" >
<resultMap id="BaseResultMap" type="com.xxfc.platform.activity.entity.IntegralRule" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="period" property="period" jdbcType="BIT" />
<result column="number" property="number" jdbcType="INTEGER" />
<result column="point" property="point" jdbcType="INTEGER" />
<result column="price" property="price" jdbcType="DECIMAL" />
<result column="is_continuity" property="isContinuity" jdbcType="BIT" />
<result column="finish_day" property="finishDay" jdbcType="INTEGER" />
<result column="finish_point" property="finishPoint" jdbcType="INTEGER" />
<result column="status" property="status" jdbcType="BIT" />
<result column="crt_time" property="crtTime" jdbcType="BIGINT" />
<result column="isdel" property="isdel" jdbcType="BIT" />
<result column="start_time" property="startTime" jdbcType="BIGINT" />
<result column="end_time" property="endTime" jdbcType="BIGINT" />
<result column="upd_time" property="updTime" jdbcType="BIGINT" />
<result column="remarks" property="remarks" jdbcType="VARCHAR" />
<result column="desc" property="desc" jdbcType="VARCHAR" />
<result column="img" property="img" jdbcType="VARCHAR" />
<result column="order_id" property="orderId" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="regulation" property="regulation" jdbcType="LONGVARCHAR" />
<result column="other_rule" property="otherRule" jdbcType="LONGVARCHAR" />
</resultMap>
<select id="selectAllByParam" resultType="com.xxfc.platform.activity.entity.IntegralRule" parameterType="com.xxfc.platform.activity.entity.IntegralRule">
select * from integral_rule
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="name != null">
and name like concat("%", #{name}, "%")
</if>
</where>
order by order_id DESC ,crt_time DESC
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.activity.mapper.IntegralSignRecordMapper" >
<resultMap id="BaseResultMap" type="com.xxfc.platform.activity.entity.IntegralSignRecord" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="sign_days" property="signDays" jdbcType="INTEGER" />
<result column="start_time" property="startTime" jdbcType="BIGINT" />
<result column="last_time" property="lastTime" jdbcType="BIGINT" />
</resultMap>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.activity.mapper.IntegralUserRecordMapper" >
<resultMap id="BaseResultMap" type="com.xxfc.platform.activity.entity.IntegralUserRecord" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="BIT" />
<result column="point" property="point" jdbcType="INTEGER" />
<result column="integral_rule_id" property="integralRuleId" jdbcType="INTEGER" />
<result column="crt_time" property="crtTime" jdbcType="BIGINT" />
<result column="is_valid" property="isValid" jdbcType="BIT" />
<result column="isdel" property="isdel" jdbcType="BIT" />
<result column="channel_id" property="channelId" jdbcType="INTEGER" />
</resultMap>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.xxfc.platform.activity.mapper.IntegralUserTotalMapper" >
<resultMap id="BaseResultMap" type="com.xxfc.platform.activity.entity.IntegralUserTotal" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="total_point" property="totalPoint" jdbcType="INTEGER" />
<result column="rest_point" property="restPoint" jdbcType="INTEGER" />
<result column="crt_time" property="crtTime" jdbcType="BIGINT" />
<result column="upd_time" property="updTime" jdbcType="BIGINT" />
</resultMap>
<select id="selectAllByParam" parameterType="com.xxfc.platform.activity.entity.IntegralUserTotal" resultType="com.xxfc.platform.activity.entity.IntegralUserTotal">
select * from integral_user_total
<where>
<if test="userId != null">
and user_id = #{userId}
</if>
</where>
order by upd_time DESC
</select>
</mapper>
\ No newline at end of file
......@@ -59,8 +59,8 @@ public class AppVersionController extends BaseController<AppVersionBiz,AppVersio
@ApiOperation("查询")
@RequestMapping(value = "/{id}",method = RequestMethod.GET)
public ObjectRestResponse<AppVersion> get(@PathVariable Integer id){
@RequestMapping(value = "/getAppVersion/{id}",method = RequestMethod.GET)
public ObjectRestResponse<AppVersion> getAppVersion(@PathVariable Integer id){
return ObjectRestResponse.succ(baseBiz.get(id));
}
......
......@@ -134,6 +134,7 @@ public class BaseOrderController extends CommonBaseController {
@ResponseBody
@ApiOperation(value = "获取后台订单列表")
@IgnoreClientToken
@CrossOrigin
public ObjectRestResponse<PageDataVO<OrderPageVO>> selectByUser(QueryOrderList dto) {
if (dto.getStartTime() != null) {
if (dto.getEndTime() == null) {
......
......@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
......@@ -93,20 +94,19 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
}
/**
* 添加和更新
* @param id
* 删除
* @param
* @return
*/
@ApiOperation("删除")
@PostMapping(value = "/app/del")
@Transactional
public ObjectRestResponse<TourUser> del(@RequestParam(value = "id",defaultValue = "0")Integer id){
@Transactional(rollbackFor = Exception.class)
public ObjectRestResponse<TourUser> del(@RequestBody TourUser tourUser){
try {
TourUser tourUser1=new TourUser();
tourUser1.setId(id);
tourUser1.setIsdel(1);
baseBiz.updateSelectiveById(tourUser1);
tourUser.setIsdel(1);
baseBiz.updateSelectiveById(tourUser);
return ObjectRestResponse.succ();
} catch (Exception e) {
e.printStackTrace();
......@@ -149,4 +149,8 @@ public class TourUserController extends TourBaseController<TourUserBiz> {
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.xxfc.platform.vehicle.rest;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.vehicle.biz.VehicleLicenseBiz;
import com.xxfc.platform.vehicle.common.RestResponse;
......@@ -60,6 +61,8 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
return RestResponse.suc(baseBiz.getOneById(id));
}
@RequestMapping(value = "/license/company/getOne", method = RequestMethod.GET)
@IgnoreUserToken
@IgnoreClientToken
public RestResponse<VehicleUserLicense> getOne(
@RequestParam(value="id",defaultValue="0")Integer id) throws Exception {
return RestResponse.suc(baseBiz.getOneById(id));
......
......@@ -96,7 +96,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
* @return
*/
@ApiOperation("车型列表")
@PostMapping(value = "/app/unauthfind/VehicleModelPage")
@PostMapping(value = "/app/unauthfind/findVehicleModelPage")
public ObjectRestResponse<VehicleModelVo> findVehicleModelPageUnauthfind(
@RequestBody @ApiParam("查询条件") VehicleModelQueryCondition vmqc ,HttpServletRequest request) {
......@@ -282,7 +282,7 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
}
@ApiOperation("查询所有")
@ApiOperation("优质车型")
@GetMapping(value = "/goodList")
public List<GoodDataVO> goodList(@RequestParam("page") Integer page,@RequestParam("limit") Integer limit){
return baseBiz.goodList(page,limit);
......@@ -296,9 +296,9 @@ public class VehicleModelController extends BaseController<VehicleModelBiz, Vehi
* @return
*/
@ApiOperation("车型列表")
@PostMapping(value = "/app/VehicleModelPage")
@PostMapping(value = "/app/findVehicleModelPage")
public ObjectRestResponse<VehicleModelVo> findVehicleModelPage(
@RequestBody @ApiParam("查询条件") VehicleModelQueryCondition vmqc ,HttpServletRequest request) {
@RequestBody @ApiParam("查询条件") VehicleModelQueryCondition vmqc ) {
if (vmqc.getIsDel()==null) {
vmqc.setIsDel(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment