书籍管理

main
tamguo 7 years ago
parent 547a63a0a0
commit cc35e2976f

@ -5,9 +5,9 @@ public class BookCondition {
private Integer pageNo;
private Integer pageSize;
private String id;
private String publishingHouse;
private String name;
private String subjectId;
private String courseId;
public Integer getPageNo() {
@ -22,12 +22,6 @@ public class BookCondition {
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public String getSubjectId() {
return subjectId;
}
public void setSubjectId(String subjectId) {
this.subjectId = subjectId;
}
public String getCourseId() {
return courseId;
}
@ -46,5 +40,11 @@ public class BookCondition {
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}

@ -5,7 +5,7 @@ public class CourseCondition {
private Integer pageNo;
private Integer pageSize;
private String uid;
private String id;
private String name;
private String status;
private String subjectId;
@ -22,12 +22,6 @@ public class CourseCondition {
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getName() {
return name;
}
@ -46,5 +40,11 @@ public class CourseCondition {
public void setSubjectId(String subjectId) {
this.subjectId = subjectId;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}

@ -36,8 +36,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, CourseEntity> i
public Page<CourseEntity> listData(CourseCondition condition) {
Page<CourseEntity> page = new Page<>(condition.getPageNo() , condition.getPageSize());
Condition query = Condition.create();
if(!StringUtils.isEmpty(condition.getUid())) {
query.eq("uid", condition.getUid());
if(!StringUtils.isEmpty(condition.getId())) {
query.eq("id", condition.getId());
}
if(!StringUtils.isEmpty(condition.getName())) {
query.like("name", condition.getName());

@ -25,17 +25,17 @@
LEFT JOIN tiku_course c ON c.id = b.course_id
WHERE
1 = 1
<if test="id != null and id != ''">
and b.id = #{id}
</if>
<if test="name != null and name != ''">
and b.name = #{name}
</if>
<if test="publishingHouse != null and publishingHouse != ''">
and b.publishing_house = #{publishingHouse}
</if>
<if test="subjectId != null and subjectId != ''">
and b.subject_id = #{subjectId}
</if>
<if test="courseId != null and courseId != ''">
and b.course_id = #{courseId}
and (b.course_id = #{courseId} or b.subject_id = #{courseId})
</if>
</select>
</mapper>

@ -120,7 +120,7 @@ public class CourseController {
}
}
@RequestMapping(path="treeData",method=RequestMethod.POST)
@RequestMapping(path="treeData",method=RequestMethod.GET)
@ResponseBody
public JSONArray treeData() {
return iCourseService.treeData();

@ -39,6 +39,12 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
</div>
<div class="box-body">
<form id="searchForm" th:action="${setting.domain + 'tiku/book/listData'}" method="post" class="form-inline " data-page-no="1" data-page-size="10" data-order-by="">
<div class="form-group">
<label class="control-label">书籍编号:</label>
<div class="control-inline">
<input type="text" id="id" name="id" value="" maxlength="100" class="form-control width-90"/>
</div>
</div>
<div class="form-group">
<label class="control-label">书籍名称:</label>
<div class="control-inline">
@ -52,12 +58,86 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
</div>
</div>
<div class="form-group">
<label class="control-label">题库分类:</label>
<div class="control-inline width-120">
<select id="subjectId" name="subjectId" class="form-control">
<option value="">&nbsp;</option>
<option th:value="${subject.id}" th:each="subject,subjectStat:${subjectList}" th:text="${subject.name}">财务经理</option>
</select>
<label class="control-label">科目:</label>
<div class="control-inline width-90">
<div class="input-group treeselect" id="officeDiv" data-url="tiku/course/treeData?">
<input id="courseId" type="hidden" name="courseId" value="" class="isReset"/>
<input id="courseName" type="text" name="courseName" value=""
class="form-control " readonly="readonly"
/><span class="input-group-btn"><a id="officeButton" href="javascript:"
class="btn btn-default btn-sm"><i class="fa fa-search"></i></a>
</span>
</div>
<script>
$("#officeButton,#courseName").click(function(){
if ($("#officeButton").hasClass("disabled")){
return true;
}
var options = {
type: 2,
maxmin: true,
shadeClose: true,
title: '机构选择',
area: ['300px', '400px'],
content: 'sys/treeselect',
contentFormData: {
url: $('#officeDiv').attr('data-url'),
checkbox: 'false',
expandLevel: '-1',
selectCodes: $("#courseId").val(),
isReturnValue: 'false'
},
success: function(layero, index){
if ($(js.layer.window).width() < 300
|| $(js.layer.window).height() < 400){
js.layer.full(index);
}
},
btn: ['<i class="fa fa-check"></i> 确定'],
btn1: function(index, layero){
var win = js.layer.iframeWindow(index);
win.$('#keyword').val('').change(); var codes = [], names = [], nodes;
if ("false" == "true"){
nodes = win.tree.getCheckedNodes(true);
}else{
nodes = win.tree.getSelectedNodes();
}
for(var i=0; i<nodes.length; i++) {
var code = nodes[i]['false'=='true'?'value':'id'], name = nodes[i]['name'];
codes.push(code.replace(/^u_/g,''));
names.push(name.replace(/\([0-9]*\)/g,''));
break;
}
if(typeof treeselectCheck == 'function'){
if (!treeselectCheck('office', nodes)){
return false;
}
}
$("#courseId").val(codes.join(',')).change();
$("#courseName").val(names.join(',')).change();
try { $('#courseId,#courseName').valid(); }catch(e){}
if(typeof treeselectCallback == 'function'){
treeselectCallback('office', 'ok', index, layero, nodes);
}
}
};
options.btn.push('<i class="fa fa-eraser"></i> 清除');
options['btn'+options.btn.length] = function(index, layero){
$("#courseId").val('').change();
$("#courseName").val('').change();
if(typeof treeselectCallback == 'function'){
treeselectCallback('office', 'clear', index, layero);
}
};
options.btn.push('<i class="fa fa-close"></i> 关闭');
options['btn'+options.btn.length] = function(index, layero){
if(typeof treeselectCallback == 'function'){
treeselectCallback('office', 'cancel', index, layero);
}
};
js.layer.open(options);
});
</script>
</div>
</div>

Loading…
Cancel
Save