Commit ee77bcef authored by maliang's avatar maliang

上传bug修复

parent 621fa2c6
......@@ -36,4 +36,11 @@ public class CopyrightBookController {
BaseSettlement baseSettlement = request.getBaseSettlement();
copyrightDao.updateSettlementStatus(baseSettlement.getCopyrightId(),baseSettlement.getReportDate(),baseSettlement.getStatus(),baseSettlement.getStatusName());
}
@PostMapping("/bookInfo")
@ApiOperation(value = "获取书籍上架信息")
@ResponseBody
public String getBookInfo(@RequestBody PageTableRequest request) {
return copyrightBookService.selectBookInfo(request.getCopyrightIds());
}
}
......@@ -13,6 +13,10 @@ public interface CopyrightDao {
Integer selectTableListMonthCount(@Param("copyrightId") Integer copyrightId);
List<BaseSettlement> selectBookInfo(@Param("copyrightId") Integer copyrightId);
Integer selectBookInfoCount(@Param("copyrightId") Integer copyrightId);
List<BaseSettlement> selectCopyrightAll();
List<BaseSettlement> selectBookDetail(@Param("copyrightIdList") List<BaseSettlement> copyrightIdList,@Param("bookId") Long bookId,@Param("bookName") String bookName);
......
......@@ -13,6 +13,7 @@ public class BaseSettlement extends BaseEntity<Long>{
public String kouliang_ratio;
public String batch_id;
public String batch_name;
public Integer cpId;
public String bookId;
public String bookName;
public String authors;
......@@ -27,6 +28,13 @@ public class BaseSettlement extends BaseEntity<Long>{
public Integer status;
public String statusName;
public Integer getCpId() {
return cpId;
}
public void setCpId(Integer cpId) {
this.cpId = cpId;
}
public Double getCountSettlement() {
return countSettlement;
......
......@@ -5,4 +5,5 @@ import com.boot.security.server.model.BaseSettlement;
public interface CopyrightBookService {
String selectSettlement(Integer copyrightId,Integer page,Integer limit);
String getAllCopyright();
String selectBookInfo(Integer copyrightId);
}
......@@ -112,4 +112,14 @@ public class CopyrightBookServiceImpl implements CopyrightBookService {
jsonObject.put("data",baseSettlements);
return jsonObject.toJSONString();
}
@Override
public String selectBookInfo(Integer copyrightId) {
if(copyrightId==null||copyrightId==0){
copyrightId=null;
}
List<BaseSettlement> baseSettlements = copyrightDao.selectBookInfo(copyrightId);
Integer count = copyrightDao.selectBookInfoCount(copyrightId);
return PageTableHandler.getJSONObject(baseSettlements,count);
}
}
......@@ -37,6 +37,22 @@
FROM bi_report.book_banquanweihu a group by a.copyright_id,a.copyright_name;
</select>
<select id="selectBookInfo" resultType="com.boot.security.server.model.BaseSettlement" >
SELECT book_id bookId,cp_id cpId,book_name bookName,authors
FROM bi_report.books_api
<if test="copyrightId != null">
where copyright_id=#{copyrightId}
</if>
</select>
<select id="selectBookInfoCount" resultType="Integer" >
SELECT count(*)
FROM bi_report.books_api
<if test="copyrightId != null">
where copyright_id=#{copyrightId}
</if>
</select>
<select id="selectBookDetail" resultType="com.boot.security.server.model.BaseSettlement" parameterType="java.util.List">
select reportDate,copyright_id copyrightId,copyright_name copyrightName,book_id bookId,book_name bookName,authors,sum(total_amount) totalAmount,sum(total_ad_amount) totalAdvertAmount
from
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>广告主数据汇总</title>
</head>
<link rel="stylesheet" href="../../css/treetable/jquery.treetable.css" />
<link rel="stylesheet" href="../../css/treetable/jquery.treetable.theme.default.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../../layui/css/layui.css">
<body>
<div class="layui-container">
<div class="layui-form">
<div class="layui-row">
<div style="width: 160px" class="layui-col-md3">
<select id="copyrightId" lay-filter="copyright">
<option value="0">全部</option>
</select>
</div>
</div>
<div class="layui-row">
<table class="layui-table" id="bookInfo" lay-filter="test">
</table>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../js/jq.js"></script>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="../../js/my/permission.js"></script>
<script src="../../js/libs/jquery.treetable.js"></script>
<script type="text/javascript" src="../../js/echarts.min.js"></script>
<script>
var copyrightId;
copyrightId=$("#copyrightId");
var form;
var copyrights;
var tableIns;
layui.use('table', function() {
var table = layui.table;
tableIns=table.render({
elem: '#bookInfo'
,method:'post'
,contentType:'application/json'
,url: '/copyrightBookController/bookInfo'
,page: true
,toolbar:'true'
,defaultToolbar: ['exports']
,cols: [[
{field: 'bookId', title: '必看bookId',fixed:'left'}
,{field: 'cpId', title: 'CPookId'}
,{field: 'bookName', title: '书名'}
,{field: 'authors', title: '作者',fixed:'right'}
]] //设置表头
});
});
layui.use('form', function() {
form = layui.form;
form.on('select(copyright)', function(data){
copyrights=data.value;
reload(copyrights)
});
});
function reload(data) {
//执行重载
tableIns.reload({
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
copyrightIds: data
}
});
}
function init(){
//var list={copyrightId:copyrightId};
$.ajax({
//请求方式
type : "post",
//请求的媒体类型
contentType: "application/json;charset=UTF-8",
//请求地址
url : "/copyrightBookController/getAllCopyright",
async:false,
//数据,json字符串
//data : JSON.stringify(list),ajax controller有请求参数必须传参写data
//请求成功
success : function(result) {
var jsonObj = JSON.parse(result);
setOption(jsonObj.data);
}
});
}
function setOption(data){
var len=data.length;
for(j = 0; j < len; j++) {
copyrightId.append("<option value="+data[j].copyrightId+">"+data[j].copyrightName+"</option>");
}
}
init();
</script>
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