Commit 185e6ef3 authored by maliang's avatar maliang

上传bug修复

parent 463b4ac8
......@@ -16,13 +16,13 @@ public class CopyrightBookController {
@ApiOperation(value = "获取月结算数据")
@ResponseBody
public String getSettlementMonthData(@RequestBody PageTableRequest request) {
return copyrightBookService.selectSettlement(request.getBaseSettlement(),request.getPage(),request.getLimit());
return copyrightBookService.selectSettlement(request.getCopyrightIds(),request.getPage(),request.getLimit());
}
@PostMapping("/getAllCopyright")
@ApiOperation(value = "获取月结算数据")
@ApiOperation(value = "版权方数据")
@ResponseBody
public String getAllCopyright(@RequestBody PageTableRequest request){
public String getAllCopyright(){
return copyrightBookService.getAllCopyright();
}
}
......@@ -9,9 +9,9 @@ import java.util.List;
@Mapper
public interface CopyrightDao {
List<BaseSettlement> selectTableListMonth(@Param("copyrightId") BaseSettlement copyrightId,@Param("page") Integer page,@Param("limit")Integer limit);
List<BaseSettlement> selectTableListMonth(@Param("copyrightId") Integer copyrightId,@Param("page") Integer page,@Param("limit")Integer limit);
Integer selectTableListMonthCount(@Param("copyrightId") BaseSettlement copyrightId);
Integer selectTableListMonthCount(@Param("copyrightId") Integer copyrightId);
List<BaseSettlement> selectCopyrightAll();
......
......@@ -23,17 +23,17 @@ public class PageTableRequest implements Serializable {
private String startTime;
private String endTime;
private Integer advertiserId;
private Integer CopyrightId;
private Integer copyrightIds;
private String advertId;
private AdvertiserData advertiserData;
private BaseSettlement baseSettlement;
public Integer getCopyrightId() {
return CopyrightId;
public Integer getCopyrightIds() {
return copyrightIds;
}
public void setCopyrightId(Integer copyrightId) {
CopyrightId = copyrightId;
public void setCopyrightIds(Integer copyrightIds) {
this.copyrightIds = copyrightIds;
}
public BaseSettlement getBaseSettlement() {
......
......@@ -3,6 +3,6 @@ package com.boot.security.server.service;
import com.boot.security.server.model.BaseSettlement;
public interface CopyrightBookService {
String selectSettlement(BaseSettlement copyrightId,Integer page,Integer limit);
String selectSettlement(Integer copyrightId,Integer page,Integer limit);
String getAllCopyright();
}
......@@ -15,7 +15,7 @@ public class CopyrightBookServiceImpl implements CopyrightBookService {
@Autowired
CopyrightDao copyrightDao;
@Override
public String selectSettlement(BaseSettlement copyrightId,Integer page,Integer limit) {
public String selectSettlement(Integer copyrightId,Integer page,Integer limit) {
List<BaseSettlement> baseSettlements = copyrightDao.selectTableListMonth(copyrightId,page-1,limit);
Integer count = copyrightDao.selectTableListMonthCount(copyrightId);
return PageTableHandler.getJSONObject(baseSettlements,count);
......
......@@ -12,7 +12,7 @@
ON a.report_date=b.report_date AND a.batch_id=b.batch_id AND a.batch_name=b.batch_name
<if test="copyrightId != null">
WHERE
a.copyright_id =#{copyrightId.copyright_id}
a.copyright_id =#{copyrightId}
</if>
ORDER BY a.total_amount DESC
limit #{page},#{limit};
......@@ -27,14 +27,14 @@
ON a.report_date=b.report_date AND a.batch_id=b.batch_id AND a.batch_name=b.batch_name
<if test="copyrightId != null">
WHERE
a.copyright_id =#{copyrightId.copyright_id}
a.copyright_id =#{copyrightId}
</if>
ORDER BY a.total_amount DESC ;
</select>
<select id="selectCopyrightAll" resultType="com.boot.security.server.model.BaseSettlement" >
SELECT a.copyright_id as copyrightId,a.copyright_name as copyrightName
FROM bi_report.book_banquanweihu group by copyright_id,copyright_name;
FROM bi_report.book_banquanweihu a group by a.copyright_id,a.copyright_name;
</select>
<select id="selectBookDetail" resultType="com.boot.security.server.model.BaseSettlement" parameterType="java.util.List">
......
......@@ -42,15 +42,15 @@
</script>
<script>
var copyrightId=$("#copyrightId");
var copyrightId;
copyrightId=$("#copyrightId");
var form;
copyrightId=$("#copyrightId").val();
var table;
var copyrights;
var tableIns;
layui.use('table', function() {
table = layui.table;
table.render({
var table = layui.table;
tableIns=table.render({
elem: '#copyrightMonth_table'
,method:'post'
,contentType:'application/json'
......@@ -63,7 +63,7 @@
,{field: 'totalAmount', title: '销售金额'}
,{field: 'totalAdvertAmount', title: '广告金额'}
,{field: 'jiesuanStatusName', title: '结算状态'}
,{title: '操作', templet: '#operation'}
,{title: '操作', templet: '#operation',fixed: 'right'}
]] //设置表头
});
});
......@@ -72,13 +72,29 @@
layui.use('form', function() {
form = layui.form;
form.on('select(copyright)', function(data){
copyrightId=data.value;
var BaseSettlement={copyrightId:copyrightId};
copyrights=data.value;
//tableIns.reload({where:{copyrightIds:copyrights}});
//console.log(copyrights)
reload(copyrights)
});
});
function reload(data) {
//执行重载
tableIns.reload({
page: {
curr: 1 //重新从第 1 页开始
}
,where: {
copyrightIds: data
}
});
}
function init(){
var list={copyrightId:copyrightId};
//var list={copyrightId:copyrightId};
$.ajax({
//请求方式
type : "post",
......@@ -88,7 +104,7 @@
url : "/copyrightBookController/getAllCopyright",
async:false,
//数据,json字符串
data : JSON.stringify(list),
//data : JSON.stringify(list),ajax controller有请求参数必须传参写data
//请求成功
success : function(result) {
var jsonObj = JSON.parse(result);
......@@ -98,7 +114,8 @@
}
function setOption(data){
for(j = 0,len=data.length; j < len; j++) {
var len=data.length;
for(j = 0; j < len; j++) {
copyrightId.append("<option value="+data[j].copyrightId+">"+data[j].copyrightName+"</option>");
}
}
......
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