Commit 5d1229fc authored by Quxl's avatar Quxl

x

parent ec87d199
package com.egolm.xplayer.web.api.admin; package com.egolm.xplayer.web.api.admin;
import java.math.BigDecimal;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.SQLException; import java.sql.SQLException;
...@@ -14,6 +15,7 @@ import org.springframework.jdbc.core.PreparedStatementCreator; ...@@ -14,6 +15,7 @@ import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.support.GeneratedKeyHolder; import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder; import org.springframework.jdbc.support.KeyHolder;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -23,6 +25,7 @@ import com.egolm.common.StringUtil; ...@@ -23,6 +25,7 @@ import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.xplayer.bean.T_licence;
import com.egolm.xplayer.bean.T_video; import com.egolm.xplayer.bean.T_video;
import com.egolm.xplayer.bean.T_video_source; import com.egolm.xplayer.bean.T_video_source;
import com.egolm.xplayer.bean.model.T_video_model; import com.egolm.xplayer.bean.model.T_video_model;
...@@ -68,12 +71,28 @@ public class AdminVideoController { ...@@ -68,12 +71,28 @@ public class AdminVideoController {
} }
@ResponseBody @ResponseBody
@Transactional
@PostMapping("doSalesUpdate") @PostMapping("doSalesUpdate")
public Rjx doSalesUpdate(Integer id) { public Rjx doSalesUpdate(Integer id) {
T_video vm = new T_video(); T_video v = new T_video();
vm.setId(id); v.setId(id);
vm.setIs_sales(1); v.setIs_sales(1);
common.merge(vm); common.merge(v);
{
List<T_licence> licenceList = jdbcTemplate.queryForBeans("select * from t_licence where video_id = ? and is_close = 0 and is_sales = 1", T_licence.class, id);
if(licenceList == null || licenceList.size() == 0) {
T_licence licence = new T_licence();
licence.setCreate_time(new Date());
licence.setExpire_hours(36);
licence.setIs_close(0);
licence.setIs_sales(1);
licence.setPrice(new BigDecimal(5.00));
licence.setVideo_id(id);
common.save(licence);
}
}
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
dataType: "json", dataType: "json",
success: function(json) { success: function(json) {
if(json.code == 200) { if(json.code == 200) {
window.location.href = "mvlist.html"; window.location.href = "vlist.html";
} else if(args && args.username){ } else if(args && args.username){
$("#message").text(json.message); $("#message").text(json.message);
$("#message").show(); $("#message").show();
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<el-form-item> <el-form-item>
<el-button size="mini" type="primary" @click="loadData">检索</el-button> <el-button size="mini" type="primary" @click="loadData">检索</el-button>
</el-form-item> </el-form-item>
<el-button size="mini" type="danger" style="float:right;" @click="doExit">退出</el-button>
</el-form> </el-form>
<el-button size="mini" type="primary" @click="toAdd">新建视频档案</el-button> <el-button size="mini" type="primary" @click="toAdd">新建视频档案</el-button>
<el-button size="mini" type="danger" @click="doImport">从电影节导入视频档案</el-button> <el-button size="mini" type="danger" @click="doImport">从电影节导入视频档案</el-button>
...@@ -218,13 +218,18 @@ ...@@ -218,13 +218,18 @@
confirmButtonText: "确定", confirmButtonText: "确定",
}); });
}, },
changePageSize: function(val) { changePageSize(val) {
this.searchForm.limit = val; this.searchForm.limit = val;
this.loadData(); this.loadData();
}, },
changePageIndex: function(val) { changePageIndex(val) {
this.searchForm.index = val; this.searchForm.index = val;
this.loadData(); this.loadData();
},
doExit() {
$.post("doLogout", function(json) {
window.location.href = "login.html";
});
} }
}, },
mounted() { mounted() {
......
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