Skip to content

Commit

Permalink
!12 合并主分支
Browse files Browse the repository at this point in the history
Merge pull request !12 from lcg0124/master
  • Loading branch information
lcg0124 committed Jan 15, 2018
2 parents 96d309d + e4a5ba4 commit d9285e7
Show file tree
Hide file tree
Showing 18 changed files with 559 additions and 508 deletions.
24 changes: 0 additions & 24 deletions bootdo/.gitignore

This file was deleted.

311 changes: 204 additions & 107 deletions bootdo/bootdo.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ public void edit(HttpServletResponse response, @PathVariable("id") String id) {

@DeleteMapping("/model/{id}")
public R remove(@PathVariable("id") String id) {
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
}
repositoryService.deleteModel(id);
return R.ok();
}
Expand Down Expand Up @@ -186,6 +189,9 @@ public R deploy(@PathVariable("id") String id) throws Exception {

@PostMapping("/model/batchRemove")
public R batchRemove(@RequestParam("ids[]") String[] ids) {
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
}
for (String id : ids) {
repositoryService.deleteModel(id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public ModelAndView add() {
@PostMapping("/save")
@Transactional(readOnly = false)
public R deploy(String exportDir, String category, MultipartFile file) {
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
}
String message = "";
String fileName = file.getOriginalFilename();
try {
Expand Down Expand Up @@ -148,4 +151,14 @@ public R remove(String id){
repositoryService.deleteDeployment(id,true);
return R.ok();
}
@PostMapping("/batchRemove")
public R batchRemove(@RequestParam("ids[]") String[] ids) {
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
}
for (String id : ids) {
repositoryService.deleteDeployment(id,true);
}
return R.ok();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.bootdo.activiti.domain.SalaryDO;
import com.bootdo.activiti.service.SalaryService;
import com.bootdo.activiti.utils.ActivitiUtils;
import com.bootdo.common.config.Constant;
import com.bootdo.common.controller.BaseController;
import com.bootdo.common.utils.PageUtils;
import com.bootdo.common.utils.Query;
import com.bootdo.common.utils.R;
Expand All @@ -26,7 +28,7 @@

@Controller
@RequestMapping("/act/salary")
public class SalaryController {
public class SalaryController extends BaseController{
@Autowired
private SalaryService salaryService;
@Autowired
Expand Down Expand Up @@ -66,6 +68,9 @@ String edit(@PathVariable("taskId") String taskId, Model model) {
@ResponseBody
@PostMapping("/save")
public R saveOrUpdate(SalaryDO salary) {
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
}
salary.setCreateDate(new Date());
salary.setUpdateDate(new Date());
salary.setCreateBy(ShiroUtils.getUserId().toString());
Expand All @@ -83,6 +88,9 @@ public R saveOrUpdate(SalaryDO salary) {
@ResponseBody
@RequestMapping("/update")
public R update(SalaryDO salary) {
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
}
String taskKey = activitiUtils.getTaskByTaskId(salary.getTaskId()).getTaskDefinitionKey();
if ("audit2".equals(taskKey)) {
salary.setHrText(salary.getTaskComment());
Expand All @@ -103,6 +111,9 @@ public R update(SalaryDO salary) {
@PostMapping("/remove")
@ResponseBody
public R remove(String id) {
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
}
if (salaryService.remove(id) > 0) {
return R.ok();
}
Expand All @@ -115,6 +126,9 @@ public R remove(String id) {
@PostMapping("/batchRemove")
@ResponseBody
public R remove(@RequestParam("ids[]") String[] ids) {
if (Constant.DEMO_ACCOUNT.equals(getUsername())) {
return R.error(1, "演示系统不允许修改,完整体验请部署程序");
}
salaryService.batchRemove(ids);
return R.ok();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@ public int save(NotifyDO notify) {
}
recordDao.batchSave(records);
//给在线用户发送通知
ThreadPoolExecutor executor = new ThreadPoolExecutor(1,1,0, TimeUnit.MILLISECONDS,new LinkedBlockingDeque<>());
executor.execute(new Runnable() {
@Override
public void run() {
for (UserDO userDO : sessionService.listOnlineUser()) {
for (Long userId : userIds) {
if (userId.equals(userDO.getUserId())) {
template.convertAndSendToUser(userDO.toString(), "/queue/notifications", "新消息:" + notify.getTitle());
}
}
}
}
});
executor.shutdown();
// ThreadPoolExecutor executor = new ThreadPoolExecutor(1,1,0, TimeUnit.MILLISECONDS,new LinkedBlockingDeque<>());
// executor.execute(new Runnable() {
// @Override
// public void run() {
// for (UserDO userDO : sessionService.listOnlineUser()) {
// for (Long userId : userIds) {
// if (userId.equals(userDO.getUserId())) {
// template.convertAndSendToUser(userDO.toString(), "/queue/notifications", "新消息:" + notify.getTitle());
// }
// }
// }
// }
// });
// executor.shutdown();
return r;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
* @author bootdo [email protected]
*/
@RequestMapping("/sys/menu")
@Controller
public class MenuController extends BaseController {
Expand All @@ -31,8 +35,8 @@ String menu(Model model) {
@RequiresPermissions("sys:menu:menu")
@RequestMapping("/list")
@ResponseBody
List<MenuDO> list() {
List<MenuDO> menus = menuService.list();
List<MenuDO> list(@RequestParam Map<String, Object> params) {
List<MenuDO> menus = menuService.list(params);
return menus;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.bootdo.system.service;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.stereotype.Service;
Expand All @@ -18,7 +19,7 @@ public interface MenuService {

Tree<MenuDO> getTree(Long id);

List<MenuDO> list();
List<MenuDO> list(Map<String, Object> params);

int remove(Long id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public Tree<MenuDO> getSysMenuTree(Long id) {
}

@Override
public List<MenuDO> list() {
List<MenuDO> menus = menuMapper.list(new HashMap<String,Object>(16));
public List<MenuDO> list(Map<String, Object> params) {
List<MenuDO> menus = menuMapper.list(params);
return menus;
}

Expand Down
8 changes: 4 additions & 4 deletions bootdo/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
server:
# context-path: /myboot
session-timeout: 1800
tomcat:
max-threads: 1000
min-spare-threads: 30
# tomcat:
# max-threads: 1000
# min-spare-threads: 30
port: 80
uri-encoding: utf-8
# uri-encoding: utf-8
security:
basic:
enabled: false
Expand Down
Loading

0 comments on commit d9285e7

Please sign in to comment.