Commit 185e6ef3 authored by maliang's avatar maliang

上传bug修复

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