用户中心
diff --git a/src/main/java/com/supwisdom/dlpay/api/dao/AccountDao.java b/src/main/java/com/supwisdom/dlpay/api/dao/AccountDao.java
index 733a6c2..0f7265e 100644
--- a/src/main/java/com/supwisdom/dlpay/api/dao/AccountDao.java
+++ b/src/main/java/com/supwisdom/dlpay/api/dao/AccountDao.java
@@ -5,6 +5,11 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Lock;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.jpa.repository.QueryHints;
+import org.springframework.data.repository.query.Param;
import javax.persistence.LockModeType;
import javax.persistence.QueryHint;
@@ -34,5 +39,6 @@
@Query("select a from TAccount a where a.userid = ?1 and a.subjno=?2")
TAccount findByUseridAndSubjno(String userid, String subjno);
- Page<TAccount> findAllByAccnameContaining(String accname, Pageable pageable);
+ @Query("select a from TAccount a where a.person.name like CONCAT('%',:accname,'%') ")
+ Page<TAccount> findAllByAccnameContaining(@Param("accname") String accname, Pageable pageable);
}
diff --git a/src/main/java/com/supwisdom/dlpay/api/dao/PointsAccountDao.java b/src/main/java/com/supwisdom/dlpay/api/dao/PointsAccountDao.java
index aba2853..96940b9 100644
--- a/src/main/java/com/supwisdom/dlpay/api/dao/PointsAccountDao.java
+++ b/src/main/java/com/supwisdom/dlpay/api/dao/PointsAccountDao.java
@@ -1,10 +1,18 @@
package com.supwisdom.dlpay.api.dao;
import com.supwisdom.dlpay.api.domain.TPointsAccount;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
@Repository
public interface PointsAccountDao extends JpaRepository<TPointsAccount, String> {
TPointsAccount findByUserid(String userid);
+
+ @Query("select a from TPointsAccount a where a.person.name like CONCAT('%',:name,'%') ")
+ Page<TPointsAccount> findAllByNameContaining(@Param("name") String name, Pageable pageable);
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java b/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java
index 1fda8a1..d19e905 100644
--- a/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java
+++ b/src/main/java/com/supwisdom/dlpay/api/domain/TPointsAccount.java
@@ -1,10 +1,8 @@
package com.supwisdom.dlpay.api.domain;
import com.supwisdom.dlpay.framework.util.MD5;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
+
+import javax.persistence.*;
/**
* 积分账户表
@@ -31,6 +29,18 @@
@Column(name = "LASTSAVED", precision = 15)
private String lastsaved;
+ @OneToOne
+ @JoinColumn(name = "USERID",insertable = false,updatable = false)
+ private TPerson person;
+
+ public TPerson getPerson() {
+ return person;
+ }
+
+ public void setPerson(TPerson person) {
+ this.person = person;
+ }
+
public TPointsAccount() {
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/bean/IdTypeBean.java b/src/main/java/com/supwisdom/dlpay/system/bean/IdTypeBean.java
new file mode 100644
index 0000000..d7ac784
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/system/bean/IdTypeBean.java
@@ -0,0 +1,27 @@
+package com.supwisdom.dlpay.system.bean;
+
+public class IdTypeBean {
+ private String idtype;
+ private String typename;
+
+ public IdTypeBean(String idtype,String typename){
+ this.idtype = idtype;
+ this.typename = typename;
+ }
+
+ public String getIdtype() {
+ return idtype;
+ }
+
+ public void setIdtype(String idtype) {
+ this.idtype = idtype;
+ }
+
+ public String getTypename() {
+ return typename;
+ }
+
+ public void setTypename(String typename) {
+ this.typename = typename;
+ }
+}
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/RoleController.java b/src/main/java/com/supwisdom/dlpay/system/controller/RoleController.java
index e8e4eb7..584953c 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/RoleController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/RoleController.java
@@ -44,7 +44,6 @@
}
@GetMapping("/role/loadadd")
- @PreAuthorize("hasPermission('/role/loadadd','')")
public String loadadd() {
return "system/role/form";
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java b/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
index 718fa53..a39aa52 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
@@ -1,17 +1,25 @@
package com.supwisdom.dlpay.system.controller;
+import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.api.domain.TAccount;
import com.supwisdom.dlpay.api.domain.TPerson;
+import com.supwisdom.dlpay.api.domain.TPersonIdentity;
+import com.supwisdom.dlpay.api.domain.TPointsAccount;
+import com.supwisdom.dlpay.framework.domain.TOperator;
import com.supwisdom.dlpay.framework.util.PageResult;
+import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.framework.util.WebConstant;
+import com.supwisdom.dlpay.system.bean.IdTypeBean;
import com.supwisdom.dlpay.system.bean.PersonParamBean;
import com.supwisdom.dlpay.system.service.UserDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
@Controller
public class UserController {
@@ -19,9 +27,10 @@
private UserDataService userDataService;
@GetMapping("/user/index")
- public String sysparaView() {
+ public String index() {
return "system/user/index";
}
+
@GetMapping("/user/list")
@PreAuthorize("hasPermission('/user/list','')")
@ResponseBody
@@ -41,6 +50,44 @@
return new PageResult<>(99, "系统查询错误");
}
}
+
+ @GetMapping("/user/loadadd")
+ public String add(ModelMap map) {
+ List<IdTypeBean> list = new ArrayList<>();
+ list.add(new IdTypeBean("1", "身份证"));
+ list.add(new IdTypeBean("2", "护照"));
+ list.add(new IdTypeBean("3", "驾照"));
+ list.add(new IdTypeBean("4", "港澳通行证"));
+ list.add(new IdTypeBean("5", "学工号"));
+ list.add(new IdTypeBean("9", "其他"));
+ map.put("idtypes", list);
+ return "system/user/add";
+ }
+
+ @PostMapping("/user/add")
+ @PreAuthorize("hasPermission('/user/add','')")
+ @ResponseBody
+ public JsonResult add(@RequestBody TPerson person) {
+ if (StringUtil.isEmpty(person.getName())
+ || StringUtil.isEmpty(person.getSex())
+ || StringUtil.isEmpty(person.getIdno())
+ || StringUtil.isEmpty(person.getIdtype())
+ || StringUtil.isEmpty(person.getMobile())) {
+ return JsonResult.error("参数错误");
+ }
+ return userDataService.saveUser(person);
+ }
+
+ @PostMapping("/user/del")
+ @PreAuthorize("hasPermission('/user/del','')")
+ @ResponseBody
+ public JsonResult del(@RequestParam String userid) {
+ if (StringUtil.isEmpty(userid)) {
+ return JsonResult.error("参数错误");
+ }
+ return userDataService.deleteUser(userid);
+ }
+
@GetMapping("/user/acc")
public String acc() {
return "system/user/account";
@@ -65,4 +112,53 @@
return new PageResult<>(99, "系统查询错误");
}
}
+
+ @GetMapping("/user/point")
+ public String point() {
+ return "system/user/point";
+ }
+
+ @GetMapping("/user/pointlist")
+ @PreAuthorize("hasPermission('/user/pointlist','')")
+ @ResponseBody
+ public PageResult<TPointsAccount> getDataPointList(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "searchkey", required = false) String searchKey) {
+ try {
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ PersonParamBean searchBean = new PersonParamBean();
+ searchBean.setPageNo(pageNo);
+ searchBean.setName(searchKey);
+ searchBean.setPageSize(pageSize);
+ return userDataService.getPointsByKey(searchBean);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
+ }
+ }
+
+ @PostMapping("/user/delacc")
+ @PreAuthorize("hasPermission('/user/delacc','')")
+ @ResponseBody
+ public JsonResult delacc(@RequestParam String accno) {
+ if (StringUtil.isEmpty(accno)) {
+ return JsonResult.error("参数错误");
+ }
+ return userDataService.closeAccount(accno);
+ }
+ @PostMapping("/user/delpoint")
+ @PreAuthorize("hasPermission('/user/delpoint','')")
+ @ResponseBody
+ public JsonResult delpoint(@RequestParam String userid) {
+ if (StringUtil.isEmpty(userid)) {
+ return JsonResult.error("参数错误");
+ }
+ return userDataService.deletePoint(userid);
+ }
+ @GetMapping("/user/pointdtl")
+ public String pointdtl(@RequestParam String userid,ModelMap map) {
+ map.put("userid",userid);
+ return "system/user/pointdtl";
+ }
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/UserDataService.java b/src/main/java/com/supwisdom/dlpay/system/service/UserDataService.java
index 34748c7..942196e 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/UserDataService.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/UserDataService.java
@@ -1,12 +1,17 @@
package com.supwisdom.dlpay.system.service;
+import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.api.domain.TAccount;
import com.supwisdom.dlpay.api.domain.TPerson;
+import com.supwisdom.dlpay.api.domain.TPersonIdentity;
+import com.supwisdom.dlpay.api.domain.TPointsAccount;
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.system.bean.PersonParamBean;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+
public interface UserDataService {
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
PageResult<TPerson> getPersonsByKey(PersonParamBean param);
@@ -14,4 +19,24 @@
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
PageResult<TAccount> getAccountsByKey(PersonParamBean param);
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
+ PageResult<TPointsAccount> getPointsByKey(PersonParamBean param);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ JsonResult saveUser(TPerson person);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ JsonResult deleteUser(String userid);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ JsonResult closeAccount(String accno);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
+ JsonResult deletePoint(String userid);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
+ List<TPersonIdentity> getPersonIdentity(String userid);
+
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,readOnly = true)
+ PageResult<TPointsAccount> getUserPointDTL(PersonParamBean param);
}
diff --git a/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java b/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
index 315927f..54694f5 100644
--- a/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/system/service/impl/UserDataServiceImpl.java
@@ -1,11 +1,17 @@
package com.supwisdom.dlpay.system.service.impl;
+import com.supwisdom.dlpay.api.bean.JsonResult;
import com.supwisdom.dlpay.api.dao.AccountDao;
import com.supwisdom.dlpay.api.dao.PersonDao;
+import com.supwisdom.dlpay.api.dao.PersonIdentityDao;
+import com.supwisdom.dlpay.api.dao.PointsAccountDao;
import com.supwisdom.dlpay.api.domain.TAccount;
import com.supwisdom.dlpay.api.domain.TPerson;
-import com.supwisdom.dlpay.framework.util.PageResult;
-import com.supwisdom.dlpay.framework.util.StringUtil;
+import com.supwisdom.dlpay.api.domain.TPersonIdentity;
+import com.supwisdom.dlpay.api.domain.TPointsAccount;
+import com.supwisdom.dlpay.framework.data.SystemDateTime;
+import com.supwisdom.dlpay.framework.service.SystemUtilService;
+import com.supwisdom.dlpay.framework.util.*;
import com.supwisdom.dlpay.system.bean.PersonParamBean;
import com.supwisdom.dlpay.system.service.UserDataService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -14,17 +20,26 @@
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
+import java.util.List;
+import java.util.Optional;
+
@Service
public class UserDataServiceImpl implements UserDataService {
@Autowired
private PersonDao personDao;
@Autowired
private AccountDao accountDao;
+ @Autowired
+ private PointsAccountDao pointsAccountDao;
+ @Autowired
+ private SystemUtilService systemUtilService;
+ @Autowired
+ private PersonIdentityDao personIdentityDao;
@Override
public PageResult<TPerson> getPersonsByKey(PersonParamBean param) {
Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize()
- , Sort.by(Sort.Direction.DESC,"lastsaved"));
+ , Sort.by(Sort.Direction.DESC, "lastsaved"));
if (!StringUtil.isEmpty(param.getName())) {
return new PageResult<>(personDao.findAllByNameContaining(param.getName(), pageable));
}
@@ -39,4 +54,125 @@
}
return new PageResult<>(accountDao.findAll(pageable));
}
+
+ @Override
+ public PageResult<TPointsAccount> getPointsByKey(PersonParamBean param) {
+ Pageable pageable = PageRequest.of(param.getPageNo() - 1, param.getPageSize());
+ if (!StringUtil.isEmpty(param.getName())) {
+ return new PageResult<>(pointsAccountDao.findAllByNameContaining(param.getName(), pageable));
+ }
+ return new PageResult<>(pointsAccountDao.findAll(pageable));
+ }
+
+ @Override
+ public JsonResult saveUser(TPerson person) {
+ if (!StringUtil.isEmpty(person.getUserid())) {
+ Optional<TPerson> temp = personDao.findById(person.getUserid());
+ if (!temp.isPresent()) {
+ return JsonResult.error("参数错误");
+ }
+ TPerson it = temp.get();
+ if (!person.getIdno().equals(it.getIdno())
+ || !person.getIdtype().equals(it.getIdtype())) {
+ TPerson has = personDao.findByIdentity(person.getIdtype(), person.getIdno());
+ if (has != null && !has.getUserid().equals(person.getUserid())) {
+ return JsonResult.error("证件类型、证件号已存在");
+ }
+ }
+ if (!person.getName().equals(it.getName())) {
+ TAccount account = accountDao.findByUserid(person.getUserid());
+ if (account != null) {
+ account.setAccname(person.getName());
+ accountDao.save(account);
+ }
+ }
+ if (StringUtil.isEmpty(person.getStatus())) {
+ person.setStatus(TradeDict.STATUS_NORMAL);
+ }
+ personDao.save(person);
+ } else {
+ TPerson has = personDao.findByIdentity(person.getIdtype(), person.getIdno());
+ if (has != null) {
+ return JsonResult.error("证件类型、证件号已存在");
+ }
+ SystemDateTime systemDateTime = systemUtilService.getSysdatetime();
+ person.setStatus(TradeDict.STATUS_NORMAL);
+ person.setLastsaved(systemDateTime.getHostdatetime());
+ person = personDao.save(person);
+
+ TAccount account = new TAccount();
+ account.setAccname(person.getName());
+ account.setSubjno(Subject.SUBJNO_PERSONAL_DEPOSIT);
+ account.setUserid(person.getUserid());
+ account.setStatus(person.getStatus());
+ account.setBalance(0.0);
+ account.setAvailbal(0.0);
+ account.setFrozebal(0.0);
+ account.setLowfreeFlag(false);
+ account.setMaxbal(systemUtilService.getSysparaValueAsDouble(SysparaUtil.SYSPARAID_NO1, SysparaUtil.SYSPARA_NO1_DEFAULT));
+ account.setLasttransdate(systemDateTime.getHostdate());
+ account.setLastdayDpsamt(0.0);
+ account.setLastdayTransamt(0.0);
+ account.setOpendate(systemDateTime.getHostdate());
+ account.setTac(account.generateTac());
+ accountDao.save(account);
+ }
+ return JsonResult.ok("添加成功");
+ }
+
+ @Override
+ public JsonResult deleteUser(String userid) {
+ TAccount account = accountDao.findByUserid(userid);
+ if (account != null) {
+ if (!TradeDict.STATUS_CLOSED.equals(account.getStatus()) && account.getBalance() != 0) {
+ return JsonResult.error("该用户账户未注销且余额不为0,无法删除");
+ } else {
+ accountDao.delete(account);
+ }
+ }
+ TPointsAccount pointsAccount = pointsAccountDao.findByUserid(userid);
+ if (pointsAccount != null) {
+ if (pointsAccount.getPoints() != 0) {
+ return JsonResult.error("该用户账户积分不为0,无法删除,若要删除请先删除积分账户");
+ } else {
+ pointsAccountDao.delete(pointsAccount);
+ }
+ }
+ personDao.deleteById(userid);
+ return JsonResult.ok("操作成功");
+ }
+
+ @Override
+ public JsonResult closeAccount(String accno) {
+ Optional<TAccount> opt = accountDao.findById(accno);
+ if (opt.isPresent()) {
+ TAccount acc = opt.get();
+ acc.setStatus(TradeDict.STATUS_CLOSED);
+ accountDao.save(acc);
+ return JsonResult.ok("操作成功");
+ } else {
+ return JsonResult.error("参数错误");
+ }
+ }
+
+ @Override
+ public JsonResult deletePoint(String userid) {
+ Optional<TPointsAccount> pointsAccount = pointsAccountDao.findById(userid);
+ if (pointsAccount.isPresent()) {
+ pointsAccountDao.delete(pointsAccount.get());
+ return JsonResult.ok("操作成功");
+ }else {
+ return JsonResult.error("参数错误");
+ }
+ }
+
+ @Override
+ public List<TPersonIdentity> getPersonIdentity(String userid) {
+ return null;
+ }
+
+ @Override
+ public PageResult<TPointsAccount> getUserPointDTL(PersonParamBean param) {
+ return null;
+ }
}
diff --git a/src/main/resources/templates/system/function/index.html b/src/main/resources/templates/system/function/index.html
index 3696dc7..4071d7d 100755
--- a/src/main/resources/templates/system/function/index.html
+++ b/src/main/resources/templates/system/function/index.html
@@ -10,9 +10,9 @@
<div class="layui-form toolbar">
搜索:
<input id="search-value" class="layui-input search-input" type="text" placeholder="输入功能名称"/> 
- <button id="btn-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ <button id="btn-search-func" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
- <button id="btn-add" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加父功能</button>
+ <button id="btn-add-func" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加父功能</button>
</div>
<table class="layui-table" id="table" lay-filter="table"></table>
</div>
@@ -71,11 +71,11 @@
]
});
// 搜索按钮点击事件
- $('#btn-search').click(function () {
+ $('#btn-search-func').click(function () {
let key = $('#search-value').val();
table.reload('table', {where: {searchkey: key}, page: {curr: 1}});
});
- $('#btn-add').click(function () {
+ $('#btn-add-func').click(function () {
showModel();
});
let showModel = function (data) {
diff --git a/src/main/resources/templates/system/param/paytype.html b/src/main/resources/templates/system/param/paytype.html
index 63a0cee..f7909f4 100644
--- a/src/main/resources/templates/system/param/paytype.html
+++ b/src/main/resources/templates/system/param/paytype.html
@@ -11,11 +11,11 @@
搜索:
<input id="search-paytype" class="layui-input search-input" type="text" maxlength="40" style="width: 300px;"
placeholder="输入支付方式查询"/>
- <button id="btn-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ <button id="btn-search-param" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
- <button id="btn-add" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>新 增
+ <button id="btn-add-param" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>新 增
</button>
- <button id="btn-reset" class="layui-btn layui-btn-primary" data-type="reset"><i class="layui-icon"></i>清 空
+ <button id="btn-reset-param" class="layui-btn layui-btn-primary" data-type="reset"><i class="layui-icon"></i>清 空
</button>
</div>
<table class="layui-table" id="paytypeTable" lay-filter="paytypeTable-filter"></table>
@@ -105,12 +105,12 @@
]
});
// 搜索按钮点击事件
- $('#btn-search').click(function () {
+ $('#btn-search-param').click(function () {
var paytype = $("#search-paytype").val();
table.reload('paytypeTable', {where: {paytype: paytype}, page: {curr: 1}});
});
- $('#btn-add').click(function () {
+ $('#btn-add-param').click(function () {
admin.popupCenter({
title: "新增支付能力",
path: '/param/load4addpaytype',
@@ -120,7 +120,7 @@
});
});
- $('#btn-reset').click(function () {
+ $('#btn-reset-param').click(function () {
$("#search-paytypeTable").val("");
});
diff --git a/src/main/resources/templates/system/param/syspara.html b/src/main/resources/templates/system/param/syspara.html
index ae17c1d..79d94ec 100644
--- a/src/main/resources/templates/system/param/syspara.html
+++ b/src/main/resources/templates/system/param/syspara.html
@@ -11,9 +11,9 @@
搜索:
<input id="search-paraid" class="layui-input search-input" maxlength="9" type="text" placeholder="输入参数ID"/> 
<input id="search-paraname" class="layui-input search-input" type="text" maxlength="30" placeholder="输入参数名称"/> 
- <button id="btn-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ <button id="btn-search-sysparam" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
- <button id="btn-reset" class="layui-btn layui-btn-primary" data-type="reset"><i class="layui-icon"></i>清 空</button>
+ <button id="btn-reset-sysparam" class="layui-btn layui-btn-primary" data-type="reset"><i class="layui-icon"></i>清 空</button>
</div>
<table class="layui-table" id="sysparaTable" lay-filter="sysparaTable-filter"></table>
</div>
@@ -50,7 +50,7 @@
]
});
// 搜索按钮点击事件
- $('#btn-search').click(function () {
+ $('#btn-search-sysparam').click(function () {
var paraid = $("#search-paraid").val();
var paraname = $("#search-paraname").val();
if (null != paraid && paraid.length > 0 && !(/^\d+$/.test(paraid))) {
@@ -60,7 +60,7 @@
}
});
- $('#btn-reset').click(function () {
+ $('#btn-reset-sysparam').click(function () {
$("#search-paraid").val("");
$("#search-paraname").val("");
});
diff --git a/src/main/resources/templates/system/role/index.html b/src/main/resources/templates/system/role/index.html
index e2208e0..029e3ef 100644
--- a/src/main/resources/templates/system/role/index.html
+++ b/src/main/resources/templates/system/role/index.html
@@ -10,9 +10,9 @@
<div class="layui-form toolbar">
搜索:
<input id="search-value" class="layui-input search-input" type="text" placeholder="输入角色名称"/> 
- <button id="btn-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ <button id="btn-search-role" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
- <button id="btn-add" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加角色</button>
+ <button id="btn-add-role" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加角色</button>
</div>
<table class="layui-table" id="roletable" lay-filter="roletable"></table>
</div>
@@ -48,11 +48,11 @@
]
});
// 搜索按钮点击事件
- $('#btn-search').click(function () {
+ $('#btn-search-role').click(function () {
let key = $('#search-value').val();
table.reload('roletable', {where: {searchkey: key}, page: {curr: 1}});
});
- $('#btn-add').click(function () {
+ $('#btn-add-role').click(function () {
showModel();
});
let showModel = function (data) {
diff --git a/src/main/resources/templates/system/user/account.html b/src/main/resources/templates/system/user/account.html
index bd23479..2475cf9 100644
--- a/src/main/resources/templates/system/user/account.html
+++ b/src/main/resources/templates/system/user/account.html
@@ -9,8 +9,8 @@
<div class="layui-card-body">
<div class="layui-form toolbar">
搜索:
- <input id="search-value" class="layui-input search-input" type="text" placeholder="输入用户名称"/> 
- <button id="btn-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ <input id="search-value-account" class="layui-input search-input" type="text" placeholder="输入用户名称"/> 
+ <button id="btn-search-account" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
</div>
<table class="layui-table" id="accounttable" lay-filter="accounttable"></table>
@@ -31,15 +31,18 @@
[
{field: 'accno', title: '账号',fixed: 'left', width: 100},
{field: 'person', title: '名称', width: 80,fixed: 'left', sort: true, templet: function (item) {
+ if(item.accname!=null){
+ return item.accname;
+ }
return item.person.name;
- }},
+ }},
{field: 'status', title: '状态',fixed: 'left',width: 80 , templet: function (item) {
if (item.status == 'normal') {
- return '正常'
+ return '<span class="layui-badge layui-bg-green">正常</span>'
} else if (item.status == 'closed') {
- return '注销'
+ return '<span class="layui-badge">注销</span>'
} else if (item.status == 'locked') {
- return '锁定'
+ return '<span class="layui-badge layui-bg-orange">锁定</span>'
} else {
return '异常'
}
@@ -51,42 +54,23 @@
{field: 'lasttransdate', title: '最后交易日期', width: 120,fixed: 'left', sort: true},
{field: 'opendate', title: '开户日期', width: 100,fixed: 'left', sort: true},
{
- field: 'userid', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
- let html = ' <a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>初始化支付密码</a> ';
- html += ' <a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>初始化登录密码</a> ';
- return html;
+ field: 'accno', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
+ if (item.status != 'closed') {
+ let html = ' <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>注销</a> ';
+ return html;
+ }else {
+ return '';
+ }
}
}
]
]
});
// 搜索按钮点击事件
- $('#btn-search').click(function () {
- let key = $('#search-value').val();
- table.reload('roletable', {where: {searchkey: key}, page: {curr: 1}});
+ $('#btn-search-account').click(function () {
+ let key = $('#search-value-account').val();
+ table.reload('accounttable', {where: {searchkey: key}, page: {curr: 1}});
});
- $('#btn-add').click(function () {
- showModel();
- });
- let showModel = function (data) {
- let title = data ? '编辑角色' : '添加角色';
- admin.putTempData('t_func', data);
- admin.popupCenter({
- title: title,
- path: '/role/loadadd',
- finish: function () {
- table.reload('roletable', {});
- }
- });
- };
- let showFuncModel = function (data) {
- let title = '分配功能';
- admin.putTempData('roleId', data.roleId);
- admin.popupCenter({
- title: title,
- path: '/role/loadfunc'
- });
- };
// 工具条点击事件
table.on('tool(accounttable)', function (obj) {
let data = obj.data;
@@ -94,19 +78,17 @@
console.log(data);
if (layEvent === 'edit') {
showModel(data);
- } else if (layEvent === 'addfunc') {
- showFuncModel(data);
} else if (layEvent === 'del') {
showDelete(data);
}
});
let showDelete = function (data) {
- layer.confirm('用户分配的该角色都将被删除,确定删除吗?', function (i) {
+ layer.confirm('确定注销账户吗,注销后该用户将无法使用余额?', function (i) {
layer.close(i);
layer.load(2);
let token = $("meta[name='_csrf_token']").attr("value");
- admin.go('/role/del', {
- roleid: data.roleId,
+ admin.go('/user/delacc', {
+ accno: data.accno,
_csrf: token
}, function (data) {
console.log(data.code);
@@ -121,11 +103,15 @@
} else {
layer.msg(data.msg, {icon: 2});
}
- table.reload('roletable', {});
+ table.reload('accounttable', {});
}, function (ret) {
console.log(ret);
layer.closeAll('loading');
- layer.msg('请求失败了,请稍后再试', {icon: 2});
+ if(ret.status==403){
+ layer.msg('没有权限', {icon: 2});
+ }else{
+ layer.msg('请求失败了,请稍后再试', {icon: 2});
+ }
});
});
}
diff --git a/src/main/resources/templates/system/user/add.html b/src/main/resources/templates/system/user/add.html
new file mode 100755
index 0000000..d2893e6
--- /dev/null
+++ b/src/main/resources/templates/system/user/add.html
@@ -0,0 +1,110 @@
+<!-- operator表单弹窗 -->
+<form id="user-form" lay-filter="user-form" class="layui-form model-form">
+ <input name="userid" id="userid" type="hidden"/>
+ <div class="layui-form-item">
+ <label class="layui-form-label">姓名*</label>
+ <div class="layui-input-block">
+ <input name="name" placeholder="请输入名称" type="text" class="layui-input" maxlength="100"
+ lay-verify="required" required/>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">性别</label>
+ <div class="layui-input-block">
+ <input type="radio" name="sex" value="male" title="男" checked/>
+ <input type="radio" name="sex" value="female" title="女"/>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">证件类型*</label>
+ <div class="layui-input-block">
+ <select name="idtype" id="idtype" lay-verify="required">
+ <option th:each="bean : ${idtypes}" th:value="${bean.idtype}">[[${bean.typename}]]</option>
+ </select>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">证件号*</label>
+ <div class="layui-input-block">
+ <input name="idno" placeholder="请输入证件号" type="text" class="layui-input" maxlength="100"
+ lay-verify="required" required/>
+ </div>
+ </div>
+
+ <div class="layui-form-item">
+ <label class="layui-form-label">手机号*</label>
+ <div class="layui-input-block">
+ <input name="mobile" placeholder="请输入手机号" type="text" class="layui-input" maxlength="11"
+ lay-verify="required" required/>
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">邮箱</label>
+ <div class="layui-input-block">
+ <input name="email" placeholder="请输入邮箱" type="text" class="layui-input" maxlength="100" />
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">地址</label>
+ <div class="layui-input-block">
+ <input name="addr" placeholder="请输入地址" type="text" class="layui-input" maxlength="300" />
+ </div>
+ </div>
+
+ <div class="layui-form-item model-form-footer">
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
+ <button class="layui-btn" lay-filter="user-form-submit" lay-submit id="submitbtn">保存</button>
+ </div>
+</form>
+
+<script>
+ layui.use(['layer', 'admin', 'form', 'formSelects'], function () {
+ var layer = layui.layer;
+ var admin = layui.admin;
+ var form = layui.form;
+ var url = '/user/add';
+ form.render('radio');
+ form.render('select');
+ // 回显user数据
+ var bean = admin.getTempData('t_bean');
+ if (bean) {
+ form.val('user-form', bean);
+ }
+ // 表单提交事件
+ form.on('submit(user-form-submit)', function (data) {
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ $.ajax({
+ type : "POST",
+ dataType : "json",
+ url : url,
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
+ data : JSON.stringify(data.field),
+ success : function(result) {
+ layer.closeAll('loading');
+ if (result.code == 200) {
+ layer.msg(result.msg, {icon: 1});
+ admin.finishPopupCenter();
+ } else if (result.code == 401) {
+ layer.msg(result.msg, {icon: 2, time: 1500}, function () {
+ location.replace('/login');
+ }, 1000);
+ return;
+ } else {
+ console.log('err:' + result.code);
+ layer.msg(result.msg, {icon: 2});
+ }
+ },
+ error : function() {
+ layer.closeAll('loading');
+ layer.msg("请求服务器失败!", {icon: 2});
+ }
+ });
+ return false;
+ });
+ });
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/system/user/bind.html b/src/main/resources/templates/system/user/bind.html
new file mode 100755
index 0000000..dd5561e
--- /dev/null
+++ b/src/main/resources/templates/system/user/bind.html
@@ -0,0 +1,76 @@
+<div style="padding:20px;">
+ <table class="layui-table" id="userbindtable" lay-filter="userbindtable">
+ </table>
+ <input type="hidden" id="userid" th:value="${userid}">
+</div>
+<script>
+ layui.use(['form', 'table', 'layer', 'admin', 'element'], function () {
+ let form = layui.form;
+ let admin = layui.admin;
+ form.render('select');
+ let table = layui.table;
+ let userid = admin.getTempData('userid');
+ table.render({
+ elem: '#userbindtable',
+ url: '/user/bind?userid=' + userid,
+ cols: [
+ [
+ {field: 'id', title: '资源ID', width: 80, fixed: 'left', sort: true},
+ {field: 'name', title: '资源名称', sort: true},
+ {
+ field: 'functionId', title: '所属功能', sort: true, align: 'center', templet: function (item) {
+ return $("#functionname").val();
+ }
+ },
+ {field: 'uri', title: '路径'},
+ {field: 'code', sort: true, width: 80, title: '代码'},
+ {
+ field: 'id', align: 'center', title: '操作', templet: function (item) {
+ return '<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>'
+ }
+ }
+ ]
+ ]
+ });
+ // 工具条点击事件
+ table.on('tool(userbindtable)', function (obj) {
+ let data = obj.data;
+ let layEvent = obj.event;
+ console.log(data);
+ if (layEvent === 'del') {
+ showDelete(data);
+ }
+ });
+
+ let showDelete = function (data) {
+ layer.confirm('确定删除吗?', function (i) {
+ layer.close(i);
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ admin.go('/user/delbind', {
+ resid: data.id,
+ _csrf:token
+ }, function (data) {
+ console.log(data.code);
+ layer.closeAll('loading');
+ if (data.code == 200) {
+ layer.msg(data.msg, {icon: 1});
+ } else if (data.code == 401) {
+ layer.msg(data.msg, {icon: 2, time: 1500}, function () {
+ location.replace('/login');
+ }, 1000);
+ return;
+ }
+ else {
+ layer.msg(data.msg, {icon: 2});
+ }
+ table.reload('restable', {});
+ },function(ret){
+ console.log(ret);
+ layer.closeAll('loading');
+ layer.msg('请求失败了,请稍后再试', {icon: 2});
+ });
+ });
+ }
+ });
+</script>
diff --git a/src/main/resources/templates/system/user/index.html b/src/main/resources/templates/system/user/index.html
index e2a4921..3a9d6fa 100644
--- a/src/main/resources/templates/system/user/index.html
+++ b/src/main/resources/templates/system/user/index.html
@@ -9,10 +9,10 @@
<div class="layui-card-body">
<div class="layui-form toolbar">
搜索:
- <input id="search-value" class="layui-input search-input" type="text" placeholder="输入用户名称"/> 
- <button id="btn-search" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ <input id="search-value-user" class="layui-input search-input" type="text" placeholder="输入用户名称"/> 
+ <button id="btn-search-user" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
- <button id="btn-add" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加用户</button>
+ <button id="btn-add-user" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加用户</button>
</div>
<table class="layui-table" id="usertable" lay-filter="usertable"></table>
</div>
@@ -31,14 +31,23 @@
cols: [
[
{field: 'name', title: '名称', width: 80,fixed: 'left', sort: true},
- {field: 'sex', title: '性别',fixed: 'left', width: 80},
+ {field: 'sex', title: '性别',fixed: 'left', width: 80, templet: function (item) {
+ if (item.sex == 'male') {
+ return '男'
+ } else if (item.sex == 'female') {
+ return '女'
+ } else {
+ return '男'
+ }
+ }
+ },
{field: 'status', title: '状态',fixed: 'left',width: 80 , templet: function (item) {
if (item.status == 'normal') {
- return '正常'
+ return '<span class="layui-badge layui-bg-green">正常</span>'
} else if (item.status == 'closed') {
- return '注销'
+ return '<span class="layui-badge">注销</span>'
} else if (item.status == 'locked') {
- return '锁定'
+ return '<span class="layui-badge layui-bg-orange">锁定</span>'
} else {
return '异常'
}
@@ -61,19 +70,16 @@
}
},
{field: 'idno', title: '证件号', width: 120,fixed: 'left', sort: true},
- {field: 'country', title: '国籍', width: 100,fixed: 'left', sort: true},
- {field: 'nation', title: '民族', width: 100,fixed: 'left', sort: true},
{field: 'email', title: '邮箱', width: 100,fixed: 'left', sort: true},
- {field: 'mobile', title: '手机', width: 100,fixed: 'left', sort: true},
+ {field: 'mobile', title: '手机', width: 120,fixed: 'left', sort: true},
{field: 'tel', title: '电话', width: 100,fixed: 'left', sort: true},
- {field: 'addr', title: '地址', width: 100,fixed: 'left', sort: true},
- {field: 'zipcode', title: '邮编', width: 100,fixed: 'left', sort: true},
- {field: 'lastsaved', title: '最后修改时间', width: 120,fixed: 'left', sort: true},
+ {field: 'addr', title: '地址', width: 200,fixed: 'left', sort: true},
+ {field: 'lastsaved', title: '最后修改时间', width: 140,fixed: 'left', sort: true},
{
field: 'userid', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
let html = ' <a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a> ';
- html += ' <a class="layui-btn layui-btn-xs" lay-event="other"><i class="layui-icon layui-icon-edit"></i>绑定关系</a> ';
html +='<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>';
+ /*html += '<a class="layui-btn layui-btn-xs" lay-event="other"><i class="layui-icon layui-icon-link"></i>交易记录</a> ';*/
return html;
}
}
@@ -81,52 +87,43 @@
]
});
// 搜索按钮点击事件
- $('#btn-search').click(function () {
- let key = $('#search-value').val();
- table.reload('roletable', {where: {searchkey: key}, page: {curr: 1}});
+ $('#btn-search-user').click(function () {
+ let key = $('#search-value-user').val();
+ table.reload('usertable', {where: {searchkey: key}, page: {curr: 1}});
});
- $('#btn-add').click(function () {
+ $('#btn-add-user').click(function () {
showModel();
});
let showModel = function (data) {
- let title = data ? '编辑角色' : '添加角色';
- admin.putTempData('t_func', data);
+ let title = data ? '编辑用户' : '添加用户';
+ admin.putTempData('t_bean', data);
admin.popupCenter({
title: title,
- path: '/role/loadadd',
+ path: '/user/loadadd',
finish: function () {
- table.reload('roletable', {});
+ table.reload('usertable', {});
}
});
};
- let showFuncModel = function (data) {
- let title = '分配功能';
- admin.putTempData('roleId', data.roleId);
- admin.popupCenter({
- title: title,
- path: '/role/loadfunc'
- });
- };
// 工具条点击事件
table.on('tool(usertable)', function (obj) {
let data = obj.data;
let layEvent = obj.event;
- console.log(data);
if (layEvent === 'edit') {
showModel(data);
- } else if (layEvent === 'addfunc') {
- showFuncModel(data);
+ } else if (layEvent === 'other') {
+ showOtherModel(data);
} else if (layEvent === 'del') {
showDelete(data);
}
});
let showDelete = function (data) {
- layer.confirm('用户分配的该角色都将被删除,确定删除吗?', function (i) {
+ layer.confirm('确定删除该用户吗?', function (i) {
layer.close(i);
layer.load(2);
let token = $("meta[name='_csrf_token']").attr("value");
- admin.go('/role/del', {
- roleid: data.roleId,
+ admin.go('/user/del', {
+ userid: data.userid,
_csrf: token
}, function (data) {
console.log(data.code);
@@ -141,11 +138,15 @@
} else {
layer.msg(data.msg, {icon: 2});
}
- table.reload('roletable', {});
+ table.reload('usertable', {});
}, function (ret) {
console.log(ret);
layer.closeAll('loading');
- layer.msg('请求失败了,请稍后再试', {icon: 2});
+ if(ret.status==403){
+ layer.msg('没有权限', {icon: 2});
+ }else{
+ layer.msg('请求失败了,请稍后再试', {icon: 2});
+ }
});
});
}
diff --git a/src/main/resources/templates/system/user/point.html b/src/main/resources/templates/system/user/point.html
new file mode 100644
index 0000000..036815c
--- /dev/null
+++ b/src/main/resources/templates/system/user/point.html
@@ -0,0 +1,96 @@
+<div class="layui-card">
+ <div class="layui-card-header">
+ <h2 class="header-title">积分管理</h2>
+ <span class="layui-breadcrumb pull-right">
+ <a href="#">用户中心</a>
+ <a><cite>积分管理</cite></a>
+ </span>
+ </div>
+ <div class="layui-card-body">
+ <div class="layui-form toolbar">
+ 搜索:
+ <input id="search-value-point" class="layui-input search-input" type="text" placeholder="输入用户名称"/> 
+ <button id="btn-search-point" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ </button>
+ </div>
+ <table class="layui-table" id="pointtable" lay-filter="pointtable"></table>
+ </div>
+</div>
+<script>
+ layui.use(['form', 'table', 'layer', 'admin', 'element'], function () {
+ let form = layui.form;
+ let table = layui.table;
+ let admin = layui.admin;
+ form.render('select');
+ // 渲染表格
+ table.render({
+ elem: '#pointtable',
+ url: '/user/pointlist',
+ page: true,
+ cols: [
+ [
+ {field: 'person', title: '名称',fixed: 'left', sort: true, templet: function (item) {
+ return item.person.name;
+ }},
+ {field: 'points', title: '可用积分', fixed: 'left', sort: true},
+ {field: 'lastsaved', title: '最后修改时间', fixed: 'left', sort: true},
+ {field: 'accumPoints', title: '累计获得积分', fixed: 'left', sort: true},
+ {field: 'sumpayPoints', title: '累计消费积分',fixed: 'left', sort: true},
+ {
+ field: 'userid', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
+ let html ='<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>';
+ /*html += '<a class="layui-btn layui-btn-xs" th:lay-href="/user/pointdtl?userid="'+item.userid+'><i class="layui-icon layui-icon-link"></i>交易记录</a> ';*/
+ return html;
+ }
+ }
+ ]
+ ]
+ });
+ // 搜索按钮点击事件
+ $('#btn-search-point').click(function () {
+ let key = $('#search-value-point').val();
+ table.reload('pointtable', {where: {searchkey: key}, page: {curr: 1}});
+ });
+ // 工具条点击事件
+ table.on('tool(pointtable)', function (obj) {
+ let data = obj.data;
+ let layEvent = obj.event;
+ if (layEvent === 'del') {
+ showDelete(data);
+ }
+ });
+ let showDelete = function (data) {
+ layer.confirm('确认删除吗,删除后将无法恢复', function (i) {
+ layer.close(i);
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ admin.go('/user/delpoint', {
+ userid: data.userid,
+ _csrf: token
+ }, function (data) {
+ console.log(data.code);
+ layer.closeAll('loading');
+ if (data.code == 200) {
+ layer.msg(data.msg, {icon: 1});
+ } else if (data.code == 401) {
+ layer.msg(data.msg, {icon: 2, time: 1500}, function () {
+ location.replace('/login');
+ }, 1000);
+ return;
+ } else {
+ layer.msg(data.msg, {icon: 2});
+ }
+ table.reload('pointtable', {});
+ }, function (ret) {
+ console.log(ret);
+ layer.closeAll('loading');
+ if(ret.status==403){
+ layer.msg('没有权限', {icon: 2});
+ }else{
+ layer.msg('请求失败了,请稍后再试', {icon: 2});
+ }
+ });
+ });
+ }
+ });
+</script>
\ No newline at end of file
diff --git a/src/main/resources/templates/system/user/pointdtl.html b/src/main/resources/templates/system/user/pointdtl.html
new file mode 100644
index 0000000..522063b
--- /dev/null
+++ b/src/main/resources/templates/system/user/pointdtl.html
@@ -0,0 +1,97 @@
+<div class="layui-card">
+ <div class="layui-card-header">
+ <h2 class="header-title">积分交易记录</h2>
+ <span class="layui-breadcrumb pull-right">
+ <a href="#">用户中心</a>
+ <a><cite>积分交易记录</cite></a>
+ </span>
+ </div>
+ <div class="layui-card-body">
+ <div class="layui-form toolbar">
+ 搜索:
+ <input id="search-value-point" class="layui-input search-input" type="text" placeholder="输入用户名称"/> 
+ <button id="btn-search-point" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ </button>
+ </div>
+ <table class="layui-table" id="pointtable" lay-filter="pointtable"></table>
+ </div>
+ <input type="hidden" id="userid" th:value="${userid}">
+</div>
+<script>
+ layui.use(['form', 'table', 'layer', 'admin', 'element'], function () {
+ let form = layui.form;
+ let table = layui.table;
+ let admin = layui.admin;
+ form.render('select');
+ // 渲染表格
+ table.render({
+ elem: '#pointtable',
+ url: '/user/pointlist',
+ page: true,
+ cols: [
+ [
+ {field: 'person', title: '名称',fixed: 'left', sort: true, templet: function (item) {
+ return item.person.name;
+ }},
+ {field: 'points', title: '可用积分', fixed: 'left', sort: true},
+ {field: 'lastsaved', title: '最后修改时间', fixed: 'left', sort: true},
+ {field: 'accumPoints', title: '累计获得积分', fixed: 'left', sort: true},
+ {field: 'sumpayPoints', title: '累计消费积分',fixed: 'left', sort: true},
+ {
+ field: 'userid', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
+ let html ='<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>';
+ html += '<a class="layui-btn layui-btn-xs" th:lay-href="/user/pointdtl?userid="'+item.userid+'><i class="layui-icon layui-icon-link"></i>交易记录</a> ';
+ return html;
+ }
+ }
+ ]
+ ]
+ });
+ // 搜索按钮点击事件
+ $('#btn-search-point').click(function () {
+ let key = $('#search-value-point').val();
+ table.reload('pointtable', {where: {searchkey: key}, page: {curr: 1}});
+ });
+ // 工具条点击事件
+ table.on('tool(pointtable)', function (obj) {
+ let data = obj.data;
+ let layEvent = obj.event;
+ if (layEvent === 'del') {
+ showDelete(data);
+ }
+ });
+ let showDelete = function (data) {
+ layer.confirm('确认删除吗,删除后将无法恢复', function (i) {
+ layer.close(i);
+ layer.load(2);
+ let token = $("meta[name='_csrf_token']").attr("value");
+ admin.go('/user/delpoint', {
+ userid: data.userid,
+ _csrf: token
+ }, function (data) {
+ console.log(data.code);
+ layer.closeAll('loading');
+ if (data.code == 200) {
+ layer.msg(data.msg, {icon: 1});
+ } else if (data.code == 401) {
+ layer.msg(data.msg, {icon: 2, time: 1500}, function () {
+ location.replace('/login');
+ }, 1000);
+ return;
+ } else {
+ layer.msg(data.msg, {icon: 2});
+ }
+ table.reload('pointtable', {});
+ }, function (ret) {
+ console.log(ret);
+ layer.closeAll('loading');
+ if(ret.status==403){
+ layer.msg('没有权限', {icon: 2});
+ }else{
+ layer.msg('请求失败了,请稍后再试', {icon: 2});
+ }
+ });
+ });
+ }
+ });
+</script>
\ No newline at end of file