parent
a3dad0cf62
commit
2d1bff4bc2
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,26 @@
|
||||
package com.ibeetl.jlw.dao;
|
||||
|
||||
import com.ibeetl.jlw.entity.StudentClientLink;
|
||||
import com.ibeetl.jlw.web.query.StudentClientLinkQuery;
|
||||
import org.beetl.sql.core.annotatoin.SqlResource;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.beetl.sql.core.mapper.BaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* StudentClientLink Dao
|
||||
*/
|
||||
@SqlResource("jlw.studentClientLink")
|
||||
@Repository
|
||||
public interface StudentClientLinkDao extends BaseMapper<StudentClientLink>{
|
||||
public PageQuery<StudentClientLink> queryByCondition(PageQuery query);
|
||||
public PageQuery<StudentClientLink> queryByConditionQuery(PageQuery query);
|
||||
public void deleteStudentClientLinkByIds(String ids);
|
||||
public void deleteByIds(String ids);
|
||||
public int updateGivenByIds(StudentClientLinkQuery studentClientLinkQuery);
|
||||
public List<StudentClientLink> getByIds(String ids);
|
||||
public List<StudentClientLink> getValuesByQuery(StudentClientLinkQuery studentClientLinkQuery);
|
||||
}
|
@ -0,0 +1,147 @@
|
||||
package com.ibeetl.jlw.service;
|
||||
|
||||
import cn.jlw.util.ToolUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ibeetl.admin.core.service.CoreBaseService;
|
||||
import com.ibeetl.admin.core.util.PlatformException;
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import com.ibeetl.admin.core.web.JsonReturnCode;
|
||||
import com.ibeetl.jlw.dao.StudentClientLinkDao;
|
||||
import com.ibeetl.jlw.entity.StudentClientLink;
|
||||
import com.ibeetl.jlw.web.query.StudentClientLinkQuery;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* StudentClientLink Service
|
||||
* 当分布式ID开启后请勿使用insert(*,true)
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class StudentClientLinkService extends CoreBaseService<StudentClientLink>{
|
||||
|
||||
@Autowired private StudentClientLinkDao studentClientLinkDao;
|
||||
|
||||
public PageQuery<StudentClientLink>queryByCondition(PageQuery query){
|
||||
PageQuery ret = studentClientLinkDao.queryByCondition(query);
|
||||
queryListAfter(ret.getList());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public PageQuery<StudentClientLink>queryByConditionQuery(PageQuery query){
|
||||
PageQuery ret = studentClientLinkDao.queryByConditionQuery(query);
|
||||
queryListAfter(ret.getList());
|
||||
return ret;
|
||||
}
|
||||
|
||||
public void deleteByList(List list){
|
||||
String ids = "";
|
||||
ToolUtils.deleteNullList(list);
|
||||
for(int i=0;null != list && i<list.size();i++){
|
||||
ids += list.get(i).toString()+(i==list.size()-1?"":",");
|
||||
}
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
studentClientLinkDao.deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteStudentClientLink(String ids){
|
||||
try {
|
||||
studentClientLinkDao.deleteStudentClientLinkByIds(ids);
|
||||
} catch (Exception e) {
|
||||
throw new PlatformException("批量删除StudentClientLink失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
public String addAll(StudentClientLinkQuery studentClientLinkQuery){
|
||||
String msg = "";
|
||||
List<StudentClientLink> studentClientLinkList = new ArrayList<>();
|
||||
try {
|
||||
studentClientLinkList = JSON.parseArray(studentClientLinkQuery.getStudentClientLinkJsonStr(), StudentClientLink.class);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
studentClientLinkList.add(JSONObject.parseObject(studentClientLinkQuery.getStudentClientLinkJsonStr(), StudentClientLink.class));
|
||||
} catch (Exception e1) {}
|
||||
}
|
||||
ToolUtils.deleteNullList(studentClientLinkList);
|
||||
if(null != studentClientLinkList && studentClientLinkList.size()>0){
|
||||
for(int i=0;i<studentClientLinkList.size();i++){
|
||||
StudentClientLink studentClientLink = studentClientLinkList.get(i);
|
||||
studentClientLink.setUserId(studentClientLinkQuery.getUserId());
|
||||
studentClientLink.setOrgId(studentClientLinkQuery.getOrgId());
|
||||
}
|
||||
insertBatch(studentClientLinkList);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public JsonResult add(StudentClientLinkQuery studentClientLinkQuery){
|
||||
String msg = "";
|
||||
StudentClientLink studentClientLink = studentClientLinkQuery.pojo();
|
||||
studentClientLinkDao.insert(studentClientLink);
|
||||
studentClientLinkQuery.setStudentClientLinkId(studentClientLink.getStudentClientLinkId());
|
||||
JsonResult jsonResult = new JsonResult();
|
||||
jsonResult.setData(studentClientLink.getStudentClientLinkId());//自增的ID丢进去
|
||||
jsonResult.setCode(JsonReturnCode.SUCCESS.getCode());
|
||||
jsonResult.setMsg(msg);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
public String edit(StudentClientLinkQuery studentClientLinkQuery){
|
||||
String msg = "";
|
||||
StudentClientLink studentClientLink = studentClientLinkQuery.pojo();
|
||||
studentClientLinkDao.updateTemplateById(studentClientLink);
|
||||
return msg;
|
||||
}
|
||||
|
||||
public String updateGivenByIds(StudentClientLinkQuery studentClientLinkQuery){
|
||||
String msg = "";
|
||||
if(StringUtils.isNotBlank(studentClientLinkQuery.get_given())){
|
||||
boolean flag = studentClientLinkDao.updateGivenByIds(studentClientLinkQuery) > 0;
|
||||
if(!flag){
|
||||
msg = "更新指定参数失败";
|
||||
}
|
||||
}else{
|
||||
msg = "指定参数为空";
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
public List<StudentClientLink> getValues (Object paras){
|
||||
return sqlManager.select("jlw.studentClientLink.getStudentClientLinkValues",StudentClientLink.class,paras);
|
||||
}
|
||||
|
||||
public List<StudentClientLink> getValuesByQuery (StudentClientLinkQuery studentClientLinkQuery){
|
||||
return studentClientLinkDao.getValuesByQuery(studentClientLinkQuery);
|
||||
}
|
||||
|
||||
public StudentClientLink getInfo (Long studentClientLinkId){
|
||||
StudentClientLinkQuery studentClientLinkQuery = new StudentClientLinkQuery();
|
||||
studentClientLinkQuery.setStudentClientLinkId(studentClientLinkId);
|
||||
List<StudentClientLink> list = studentClientLinkDao.getValuesByQuery(studentClientLinkQuery);
|
||||
if(null != list && list.size()>0){
|
||||
return list.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public StudentClientLink getInfo (StudentClientLinkQuery studentClientLinkQuery){
|
||||
List<StudentClientLink> list = studentClientLinkDao.getValuesByQuery(studentClientLinkQuery);
|
||||
if(null != list && list.size()>0){
|
||||
return list.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,206 @@
|
||||
package com.ibeetl.jlw.web;
|
||||
|
||||
import cn.jlw.Interceptor.SCoreUser;
|
||||
import cn.jlw.validate.ValidateConfig;
|
||||
import com.ibeetl.admin.core.annotation.Function;
|
||||
import com.ibeetl.admin.core.entity.CoreUser;
|
||||
import com.ibeetl.admin.core.file.FileService;
|
||||
import com.ibeetl.admin.core.web.JsonResult;
|
||||
import com.ibeetl.jlw.entity.StudentClientLink;
|
||||
import com.ibeetl.jlw.service.StudentClientLinkService;
|
||||
import com.ibeetl.jlw.web.query.StudentClientLinkQuery;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.beetl.sql.core.engine.PageQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* StudentClientLink 学生端-链接 接口
|
||||
* 切记不要对非线程安全的静态变量进行写操作
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class StudentClientLinkController{
|
||||
|
||||
private final Log log = LogFactory.getLog(this.getClass());
|
||||
private static final String MODEL = "/jlw/studentClientLink";
|
||||
private static final String API = "/api/studentClientLink";
|
||||
|
||||
|
||||
@Autowired private StudentClientLinkService studentClientLinkService;
|
||||
|
||||
@Autowired
|
||||
FileService fileService;
|
||||
|
||||
/* 前端接口 */
|
||||
|
||||
@PostMapping(API + "/getPageList.do")
|
||||
@ResponseBody
|
||||
public JsonResult<PageQuery> getPageList(StudentClientLinkQuery condition,@SCoreUser CoreUser coreUser){
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
PageQuery page = condition.getPageQuery();
|
||||
studentClientLinkService.queryByConditionQuery(page);
|
||||
return JsonResult.success(page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(API + "/getInfo.do")
|
||||
@ResponseBody
|
||||
public JsonResult<StudentClientLink>getInfo(StudentClientLinkQuery param,@SCoreUser CoreUser coreUser) {
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
StudentClientLink studentClientLink = studentClientLinkService.getInfo(param);
|
||||
return JsonResult.success(studentClientLink);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(API + "/getList.do")
|
||||
@ResponseBody
|
||||
public JsonResult<List<StudentClientLink>>getList(StudentClientLinkQuery param,@SCoreUser CoreUser coreUser) {
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
List<StudentClientLink>list = studentClientLinkService.getValuesByQuery(param);
|
||||
return JsonResult.success(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 后台页面 */
|
||||
|
||||
@GetMapping(MODEL + "/index.do")
|
||||
@Function("studentClientLink.query")
|
||||
@ResponseBody
|
||||
public ModelAndView index() {
|
||||
ModelAndView view = new ModelAndView("/jlw/studentClientLink/index.html") ;
|
||||
view.addObject("search", StudentClientLinkQuery.class.getName());
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/edit.do")
|
||||
@Function("studentClientLink.edit")
|
||||
@ResponseBody
|
||||
public ModelAndView edit(Long studentClientLinkId) {
|
||||
ModelAndView view = new ModelAndView("/jlw/studentClientLink/edit.html");
|
||||
StudentClientLink studentClientLink = studentClientLinkService.queryById(studentClientLinkId);
|
||||
view.addObject("studentClientLink", studentClientLink);
|
||||
return view;
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/add.do")
|
||||
@Function("studentClientLink.add")
|
||||
@ResponseBody
|
||||
public ModelAndView add(Long studentClientLinkId) {
|
||||
ModelAndView view = new ModelAndView("/jlw/studentClientLink/add.html");
|
||||
if(null != studentClientLinkId){
|
||||
StudentClientLink studentClientLink = studentClientLinkService.queryById(studentClientLinkId);
|
||||
view.addObject("studentClientLink", studentClientLink);
|
||||
}else {
|
||||
view.addObject("studentClientLink", new StudentClientLink());
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
/* 后台接口 */
|
||||
|
||||
@PostMapping(MODEL + "/list.json")
|
||||
@Function("studentClientLink.query")
|
||||
@ResponseBody
|
||||
public JsonResult<PageQuery> list(StudentClientLinkQuery condition){
|
||||
PageQuery page = condition.getPageQuery();
|
||||
studentClientLinkService.queryByCondition(page);
|
||||
return JsonResult.success(page);
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/addAll.json")
|
||||
@Function("studentClientLink.add")
|
||||
@ResponseBody
|
||||
public JsonResult addAll(StudentClientLinkQuery studentClientLinkQuery,@SCoreUser CoreUser coreUser){
|
||||
if(null == coreUser){
|
||||
return JsonResult.failMessage("请登录后再操作");
|
||||
}else{
|
||||
studentClientLinkQuery.setUserId(coreUser.getId());
|
||||
studentClientLinkQuery.setOrgId(coreUser.getOrgId());
|
||||
String msg = studentClientLinkService.addAll(studentClientLinkQuery);
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
return JsonResult.success();
|
||||
} else {
|
||||
return JsonResult.failMessage("新增失败,"+msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/add.json")
|
||||
@Function("studentClientLink.add")
|
||||
@ResponseBody
|
||||
public JsonResult add(@Validated(ValidateConfig.ADD.class) StudentClientLinkQuery studentClientLinkQuery, BindingResult result,@SCoreUser CoreUser coreUser){
|
||||
if(result.hasErrors()){
|
||||
return JsonResult.failMessage(result);
|
||||
}else{
|
||||
studentClientLinkQuery.setUserId(coreUser.getId());
|
||||
studentClientLinkQuery.setOrgId(coreUser.getOrgId());
|
||||
return studentClientLinkService.add(studentClientLinkQuery);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping(MODEL + "/edit.json")
|
||||
@Function("studentClientLink.edit")
|
||||
@ResponseBody
|
||||
public JsonResult<String> update(@Validated(ValidateConfig.UPDATE.class) StudentClientLinkQuery studentClientLinkQuery, BindingResult result) {
|
||||
if(result.hasErrors()){
|
||||
return JsonResult.failMessage(result);
|
||||
}else {
|
||||
studentClientLinkQuery.setUserId(null);
|
||||
studentClientLinkQuery.setOrgId(null);
|
||||
String msg = studentClientLinkService.edit(studentClientLinkQuery);
|
||||
if (StringUtils.isBlank(msg)) {
|
||||
return JsonResult.success();
|
||||
} else {
|
||||
return JsonResult.failMessage("更新失败,"+msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(MODEL + "/view.json")
|
||||
@Function("studentClientLink.query")
|
||||
@ResponseBody
|
||||
public JsonResult<StudentClientLink>queryInfo(Long studentClientLinkId) {
|
||||
StudentClientLink studentClientLink = studentClientLinkService.queryById( studentClientLinkId);
|
||||
return JsonResult.success(studentClientLink);
|
||||
}
|
||||
|
||||
@GetMapping(MODEL + "/getValues.json")
|
||||
@Function("studentClientLink.query")
|
||||
@ResponseBody
|
||||
public JsonResult<List<StudentClientLink>>getValues(StudentClientLinkQuery param) {
|
||||
List<StudentClientLink>list = studentClientLinkService.getValuesByQuery(param);
|
||||
return JsonResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(MODEL + "/delete.json")
|
||||
@Function("studentClientLink.delete")
|
||||
@ResponseBody
|
||||
public JsonResult delete(String ids) {
|
||||
studentClientLinkService.deleteStudentClientLink(ids);
|
||||
return JsonResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
layui.define([ 'form', 'laydate', 'table','studentClientLinkApi'], function(exports) {
|
||||
var form = layui.form;
|
||||
var studentClientLinkApi = layui.studentClientLinkApi;
|
||||
var index = layui.index;
|
||||
var view = {
|
||||
init:function(){
|
||||
Lib.initGenrealForm($("#addForm"),form);
|
||||
this.initSubmit();
|
||||
},
|
||||
initSubmit:function(){
|
||||
$("#addButton").click(function(){
|
||||
form.on('submit(form)', function(){
|
||||
var studentClientLinkId = $("#addForm input[name='studentClientLinkId']").val();
|
||||
if(!$.isEmpty(studentClientLinkId)){
|
||||
studentClientLinkApi.updateStudentClientLink($('#addForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("更新成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}else{
|
||||
studentClientLinkApi.addStudentClientLink($('#addForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("添加成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$("#addButton-cancel").click(function(){
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
exports('add',view);
|
||||
});
|
@ -0,0 +1,23 @@
|
||||
layui.define(['table', 'studentClientLinkApi'], function(exports) {
|
||||
var studentClientLinkApi = layui.studentClientLinkApi;
|
||||
var table=layui.table;
|
||||
var view = {
|
||||
init:function(){
|
||||
},
|
||||
delBatch:function(){
|
||||
var data = Common.getMoreDataFromTable(table,"studentClientLinkTable");
|
||||
if(data==null){
|
||||
return ;
|
||||
}
|
||||
Common.openConfirm("确认要删除这些StudentClientLink?",function(){
|
||||
var ids =Common.concatBatchId(data,"studentClientLinkId");
|
||||
studentClientLinkApi.del(ids,function(){
|
||||
Common.info("删除成功");
|
||||
dataReload();
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
exports('del',view);
|
||||
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
layui.define([ 'form', 'laydate', 'table','studentClientLinkApi'], function(exports) {
|
||||
var form = layui.form;
|
||||
var studentClientLinkApi = layui.studentClientLinkApi;
|
||||
var index = layui.index;
|
||||
var view = {
|
||||
init:function(){
|
||||
Lib.initGenrealForm($("#updateForm"),form);
|
||||
this.initSubmit();
|
||||
},
|
||||
initSubmit:function(){
|
||||
$("#updateButton").click(function(){
|
||||
form.on('submit(form)', function(){
|
||||
studentClientLinkApi.updateStudentClientLink($('#updateForm'),function(){
|
||||
parent.window.dataReload();
|
||||
Common.info("更新成功");
|
||||
Lib.closeFrame();
|
||||
});
|
||||
});
|
||||
});
|
||||
$("#updateButton-cancel").click(function(){
|
||||
Lib.closeFrame();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
exports('edit',view);
|
||||
|
||||
});
|
@ -0,0 +1,18 @@
|
||||
/*访问后台的代码*/
|
||||
layui.define([], function(exports) {
|
||||
var api={
|
||||
updateStudentClientLink:function(form,callback){
|
||||
Lib.submitForm("/jlw/studentClientLink/edit.json",form,{},callback)
|
||||
},
|
||||
addStudentClientLink:function(form,callback){
|
||||
Lib.submitForm("/jlw/studentClientLink/add.json",form,{},callback)
|
||||
},
|
||||
del:function(ids,callback){
|
||||
Common.post("/jlw/studentClientLink/delete.json",{"ids":ids},function(){
|
||||
callback();
|
||||
})
|
||||
}
|
||||
|
||||
};
|
||||
exports('studentClientLinkApi',api);
|
||||
});
|
@ -0,0 +1,24 @@
|
||||
<!--#layout("/common/layout.html",{"jsBase":"/js/jlw/studentClientLink/"}){ -->
|
||||
<layui:searchForm formId="searchForm" searchList="" condition="${search}">
|
||||
</layui:searchForm>
|
||||
<table id="studentClientLinkTable" lay-filter="studentClientLinkTable"></table>
|
||||
<!--#} -->
|
||||
<div class="layui-btn-container" id="toolbar_studentClientLink">
|
||||
<div class="layui-btn-group" >
|
||||
<!--# if(!isEmpty(search)) {-->
|
||||
<layui:accessButton function="studentClientLink.query" id="searchFormSearch" action="search"><i class="layui-icon"></i>搜索</layui:accessButton>
|
||||
<!--# }-->
|
||||
<layui:accessButton function="studentClientLink.add" action="add">添加</layui:accessButton>
|
||||
<layui:accessButton function="studentClientLink.edit" action="edit">修改</layui:accessButton>
|
||||
<layui:accessButton function="studentClientLink.del" action="del">删除</layui:accessButton>
|
||||
<!--# if(!isEmpty(search)) {-->
|
||||
<layui:accessButton function="studentClientLink.query" action="refresh"><i class="layui-icon"></i>刷新</layui:accessButton>
|
||||
<!--# }-->
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use(['index'], function(){
|
||||
var index = layui.index;
|
||||
index.init();
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue