纳税人信息
This commit is contained in:
@@ -56,6 +56,11 @@
|
||||
<artifactId>bss</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.cwhelp.modules</groupId>
|
||||
<artifactId>bss</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.cwhelp.admin.business.controller;
|
||||
|
||||
import com.cwhelp.common.enums.StatusEnum;
|
||||
import com.cwhelp.common.utils.EntityBeanUtil;
|
||||
import com.cwhelp.common.utils.ResultVoUtil;
|
||||
import com.cwhelp.common.utils.StatusUtil;
|
||||
import com.cwhelp.common.vo.ResultVo;
|
||||
import com.cwhelp.component.shiro.ShiroUtil;
|
||||
import com.cwhelp.modules.business.domain.BssTaxinfo;
|
||||
import com.cwhelp.modules.business.service.BssTaxinfoService;
|
||||
import com.cwhelp.admin.business.validator.BssTaxinfoValid;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.data.domain.ExampleMatcher;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
* @date 2019/08/16
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/bss/taxinfo")
|
||||
public class BssTaxinfoController {
|
||||
|
||||
@Autowired
|
||||
private BssTaxinfoService bssTaxinfoService;
|
||||
|
||||
/**
|
||||
* 列表页面
|
||||
*/
|
||||
@GetMapping("/index")
|
||||
@RequiresPermissions("bss:taxinfo:index")
|
||||
public String index(Model model, BssTaxinfo bssTaxinfo) {
|
||||
|
||||
// 创建匹配器,进行动态查询匹配
|
||||
ExampleMatcher matcher = ExampleMatcher.matching().withMatcher("platformId",match -> match.contains());
|
||||
|
||||
bssTaxinfo.setPlatformId(ShiroUtil.getSubject().getBssPlatform().getId());
|
||||
// 获取数据列表
|
||||
Example<BssTaxinfo> example = Example.of(bssTaxinfo, matcher);
|
||||
Page<BssTaxinfo> list = bssTaxinfoService.getPageList(example);
|
||||
|
||||
// 封装数据
|
||||
model.addAttribute("list", list.getContent());
|
||||
model.addAttribute("page", list);
|
||||
return "/business/taxinfo/index";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到添加页面
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
@RequiresPermissions("bss:taxinfo:add")
|
||||
public String toAdd() {
|
||||
return "/business/taxinfo/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到编辑页面
|
||||
*/
|
||||
@GetMapping("/edit/{id}")
|
||||
@RequiresPermissions("bss:taxinfo:edit")
|
||||
public String toEdit(@PathVariable("id") BssTaxinfo bssTaxinfo, Model model) {
|
||||
model.addAttribute("bssTaxinfo", bssTaxinfo);
|
||||
return "/business/taxinfo/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存添加/修改的数据
|
||||
* @param valid 验证对象
|
||||
*/
|
||||
@PostMapping({"/add","/edit"})
|
||||
@RequiresPermissions({"bss:taxinfo:add","bss:taxinfo:edit"})
|
||||
@ResponseBody
|
||||
public ResultVo save(@Validated BssTaxinfoValid valid, BssTaxinfo bssTaxinfo) {
|
||||
bssTaxinfo.setPlatformId(ShiroUtil.getSubject().getBssPlatform().getId());
|
||||
// 复制保留无需修改的数据
|
||||
if (bssTaxinfo.getId() != null) {
|
||||
BssTaxinfo beBssTaxinfo = bssTaxinfoService.getById(bssTaxinfo.getId());
|
||||
EntityBeanUtil.copyProperties(beBssTaxinfo, bssTaxinfo);
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
bssTaxinfoService.save(bssTaxinfo);
|
||||
return ResultVoUtil.SAVE_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到详细页面
|
||||
*/
|
||||
@GetMapping("/detail/{id}")
|
||||
@RequiresPermissions("bss:taxinfo:detail")
|
||||
public String toDetail(@PathVariable("id") BssTaxinfo bssTaxinfo, Model model) {
|
||||
model.addAttribute("bssTaxinfo",bssTaxinfo);
|
||||
return "/business/taxinfo/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置一条或者多条数据的状态
|
||||
*/
|
||||
@RequestMapping("/status/{param}")
|
||||
@RequiresPermissions("bss:taxinfo:status")
|
||||
@ResponseBody
|
||||
public ResultVo status(
|
||||
@PathVariable("param") String param,
|
||||
@RequestParam(value = "ids", required = false) List<Long> ids) {
|
||||
// 更新状态
|
||||
StatusEnum statusEnum = StatusUtil.getStatusEnum(param);
|
||||
if (bssTaxinfoService.updateStatus(statusEnum, ids)) {
|
||||
return ResultVoUtil.success(statusEnum.getMessage() + "成功");
|
||||
} else {
|
||||
return ResultVoUtil.error(statusEnum.getMessage() + "失败,请重新操作");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.cwhelp.admin.business.validator;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
/**
|
||||
* @author yan.y
|
||||
* @date 2019/08/16
|
||||
*/
|
||||
@Data
|
||||
public class BssTaxinfoValid implements Serializable {
|
||||
@NotEmpty(message = "纳税人识别号不能为空")
|
||||
private String taxNo;
|
||||
@NotEmpty(message = "开户行及账号不能为空")
|
||||
private String account;
|
||||
@NotEmpty(message = "地址、电话不能为空")
|
||||
private String addressPhone;
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
}
|
||||
@@ -81,7 +81,6 @@ public class RoleController {
|
||||
* 跳转到角色分配页面
|
||||
*/
|
||||
@GetMapping("/rolePage")
|
||||
@RequiresPermissions("system:user:role")
|
||||
public String toRole(@RequestParam(value = "ids") BssEmployee bssEmployee, Model model) {
|
||||
User user = userService.getByName(bssEmployee.getPhoneNum());
|
||||
if (ObjectUtils.isEmpty(user)) {
|
||||
|
||||
@@ -16,9 +16,9 @@ spring:
|
||||
## 数据库配置
|
||||
datasource:
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://139.196.24.156:3306/cwhelp?useSSL=false&characterEncoding=utf-8
|
||||
url: jdbc:mysql://47.102.154.191:3306/cwhelp_test?useSSL=false&characterEncoding=utf-8
|
||||
username: root
|
||||
password: ifish7mysql
|
||||
password: LABcwmysql
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-form timo-compile">
|
||||
<form th:action="@{/bss/taxinfo/add}">
|
||||
<input type="hidden" name="id" th:if="${bssTaxinfo}" th:value="${bssTaxinfo.id}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" type="text" name="name" placeholder="请输入名称" th:value="${bssTaxinfo?.name}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">纳税人识别号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" type="text" name="taxNo" placeholder="请输入纳税人识别号" th:value="${bssTaxinfo?.taxNo}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">开户行及账号</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" type="text" name="account" placeholder="请输入开户行及账号" th:value="${bssTaxinfo?.account}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">地址及电话</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" type="text" name="addressPhone" placeholder="请输入地址及电话" th:value="${bssTaxinfo?.addressPhone}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<label class="layui-form-label">备注</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${bssTaxinfo?.remark}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item timo-finally">
|
||||
<button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
|
||||
<button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script th:replace="/common/template :: script"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
|
||||
</head>
|
||||
<body>
|
||||
<div class="timo-detail-page">
|
||||
<div class="timo-detail-title">基本信息</div>
|
||||
<table class="layui-table timo-detail-table">
|
||||
<colgroup>
|
||||
<col width="100px"><col>
|
||||
<col width="100px"><col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td th:text="${bssTaxinfo.name}"></td>
|
||||
<th>纳税人识别号</th>
|
||||
<td th:text="${bssTaxinfo.taxNo}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>开户行及账号</th>
|
||||
<td th:text="${bssTaxinfo.account}"></td>
|
||||
<th>地址及电话</th>
|
||||
<td th:text="${bssTaxinfo.addressPhone}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td th:text="${bssTaxinfo.remark}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script th:replace="/common/template :: script"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
|
||||
</head>
|
||||
<body class="timo-layout-page">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header timo-card-header">
|
||||
<span><i class="fa fa-bars"></i> 纳税人信息管理</span>
|
||||
<i class="layui-icon layui-icon-refresh refresh-btn"></i>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-row timo-card-screen">
|
||||
<div class="pull-left layui-form-pane timo-search-box">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">状态</label>
|
||||
<div class="layui-input-block timo-search-status">
|
||||
<select class="timo-search-select" name="status" mo:dict="SEARCH_STATUS" mo-selected="${param.status}"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn timo-search-btn">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right screen-btn-group">
|
||||
<button class="layui-btn open-popup" data-title="添加纳税人信息" th:attr="data-url=@{/bss/taxinfo/add}" data-size="auto">
|
||||
<i class="fa fa-plus"></i> 添加</button>
|
||||
<div class="btn-group">
|
||||
<button class="layui-btn">操作<span class="caret"></span></button>
|
||||
<dl class="layui-nav-child layui-anim layui-anim-upbit">
|
||||
<dd><a class="ajax-status" th:href="@{/bss/taxinfo/status/ok}">启用</a></dd>
|
||||
<dd><a class="ajax-status" th:href="@{/bss/taxinfo/status/freezed}">冻结</a></dd>
|
||||
<dd><a class="ajax-status" th:href="@{/bss/taxinfo/status/delete}">删除</a></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="timo-table-wrap">
|
||||
<table class="layui-table timo-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="timo-table-checkbox">
|
||||
<label class="timo-checkbox"><input type="checkbox">
|
||||
<i class="layui-icon layui-icon-ok"></i></label>
|
||||
</th>
|
||||
<th>名称</th>
|
||||
<th>纳税人识别号</th>
|
||||
<th>开户行及账号</th>
|
||||
<th>地址及电话</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="item:${list}">
|
||||
<td><label class="timo-checkbox"><input type="checkbox" th:value="${item.id}">
|
||||
<i class="layui-icon layui-icon-ok"></i></label></td>
|
||||
<td th:text="${item.name}">名称</td>
|
||||
<td th:text="${item.taxNo}">纳税人识别号</td>
|
||||
<td th:text="${item.account}">开户行及账号</td>
|
||||
<td th:text="${item.addressPhone}">地址及电话</td>
|
||||
<td>
|
||||
<a class="open-popup" data-title="编辑纳税人信息" th:attr="data-url=@{'/bss/taxinfo/edit/'+${item.id}}" data-size="auto" href="#">编辑</a>
|
||||
<a class="open-popup" data-title="详细信息" th:attr="data-url=@{'/bss/taxinfo/detail/'+${item.id}}" data-size="800,600" href="#">详细</a>
|
||||
<a class="ajax-get" data-msg="您是否确认删除" th:href="@{/bss/taxinfo/status/delete(ids=${item.id})}">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div th:replace="/common/fragment :: page"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script th:replace="/common/template :: script"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user