Commit 22f2516a by 吴迪

【修改】修改bug

parent 187d39b5
......@@ -58,7 +58,7 @@ public class ClickDetailController {
@RequestMapping("/list")
//@RequiresPermissions("datamanage:clickdetail:list")
public R list(@RequestBody ClickDetailDTO clickDetailDTO) {
Page page = null;
Page<ClickDetailDTO> page = new Page();
if (StrUtil.equals("1", clickDetailDTO.getTypeValue())) {
page = clickDetailService.selectClickNewsList(clickDetailDTO);
} else if (StrUtil.equals("2", clickDetailDTO.getTypeValue())) {
......@@ -78,6 +78,8 @@ public class ClickDetailController {
} else if (StrUtil.equals("12", clickDetailDTO.getTypeValue())) {
page = clickDetailService.getListPageAnnounces(clickDetailDTO);
}
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
}
......@@ -108,6 +110,7 @@ public class ClickDetailController {
clickDetailService.getListPageAnnouncesExport(clickDetailDTO,response);
}
}
......
......@@ -86,5 +86,7 @@ public class ClickDetailDTO implements Serializable {
private String order;
private String releaseTimeStart;
private String releaseTimeEnd;
}
package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import io.netty.util.internal.StringUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.MedicalDao;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService;
......@@ -11,11 +14,6 @@ import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
......@@ -39,14 +37,14 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
} else {
medicalEntityQueryWrapper.gt("level",0);
}
if(params.get("sidx")!=null && StringUtils.isNotBlank(String.valueOf(params.get("sidx")))){
if(String.valueOf(params.get("sidx")).equalsIgnoreCase("type")) {
params.put("sidx","typeid");
medicalEntityQueryWrapper.orderByAsc("typeid");
}
} else{
medicalEntityQueryWrapper.orderByAsc("typeid");
}
//if(params.get("sidx")!=null && StringUtils.isNotBlank(String.valueOf(params.get("sidx")))){
// if(String.valueOf(params.get("sidx")).equalsIgnoreCase("type")) {
// params.put("sidx","typeid");
// medicalEntityQueryWrapper.orderByAsc("typeid");
// }
//} else{
// medicalEntityQueryWrapper.orderByAsc("typeid");
//}
IPage<MedicalEntity> page = this.page(
......@@ -69,4 +67,4 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
}
}
\ No newline at end of file
}
......@@ -5,6 +5,7 @@ import io.office.modules.manage.webservice.WebServiceXmlTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
......@@ -108,4 +109,49 @@ public class GLNSearchUtils {
}
public static void main(String[] args) {
String smsTemplateXml = WebServiceXmlTemplate.SEND_MESSAGE_TEMPLATE.replaceAll("\\$\\{cascade\\}", "9").replaceAll("\\$\\{requestedKeyCode\\}", "GLN")
.replaceAll("\\$\\{requestedKeyValue\\}", "6929020221650").replaceAll("\\$\\{requestedLanguage\\}", "en");
String url = "http://webservice.anccnet.com:8080/gepir4/gepirv4.asmx";
RestTemplate restTemplate = new RestTemplate();
//创建请求头
//创建请求头
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.TEXT_XML);
HttpEntity<String> entity = new HttpEntity<>("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
" <soap:Header>\n" +
" <gep:requestHeader xmlns=\"http://gepir4.ws.gs1.org/\">\n" +
" <requesterGLN xmlns=\"\">6900000000007</requesterGLN>\n" +
" <onBehalfOfGLN xmlns=\"\">6900000000007</onBehalfOfGLN>\n" +
" <isAuthenticated xmlns=\"\">true</isAuthenticated>\n" +
" <cascade xmlns=\"\">9</cascade>\n" +
" </gep:requestHeader>\n" +
" </soap:Header>\n" +
" <soap:Body>\n" +
" <getKeyLicensee xmlns=\"http://gepir4.ws.gs1.org/\">\n" +
" <getKeyLicensee xmlns=\"\">\n" +
" <getKeyLicensee>\n" +
" <requestedKeyCode>GLN</requestedKeyCode>\n" +
" <requestedKeyValue>6970974940012</requestedKeyValue>\n" +
" <requestedLanguage>en</requestedLanguage>\n" +
" </getKeyLicensee>\n" +
" </getKeyLicensee>\n" +
" </getKeyLicensee>\n" +
" </soap:Body>\n" +
"</soap:Envelope>\n", headers);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, entity, String.class);
System.out.println(responseEntity);
}
}
......@@ -44,15 +44,15 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:list")
public R list(@RequestParam Map<String, Object> params){
//如果不是超级管理员,则只查询自己创建的角色列表
// if(getUserId() != Constant.SUPER_ADMIN){
// params.put("createUserId", getUserId());
// }
if(getUserId() != Constant.SUPER_ADMIN){
params.put("createUserId", getUserId());
}
PageUtils page = sysRoleService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 角色列表
*/
......@@ -60,16 +60,16 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:select")
public R select(){
Map<String, Object> map = new HashMap<>();
//如果不是超级管理员,则只查询自己所拥有的角色列表
// if(getUserId() != Constant.SUPER_ADMIN){
// map.put("create_user_id", getUserId());
// }
if(getUserId() != Constant.SUPER_ADMIN){
map.put("create_user_id", getUserId());
}
List<SysRoleEntity> list = (List<SysRoleEntity>) sysRoleService.listByMap(map);
return R.ok().put("list", list);
}
/**
* 角色信息
*/
......@@ -77,14 +77,14 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:info")
public R info(@PathVariable("roleId") Long roleId){
SysRoleEntity role = sysRoleService.getById(roleId);
//查询角色对应的菜单
List<Long> menuIdList = sysRoleMenuService.queryMenuIdList(roleId);
role.setMenuIdList(menuIdList);
return R.ok().put("role", role);
}
/**
* 保存角色
*/
......@@ -93,13 +93,13 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:save")
public R save(@RequestBody SysRoleEntity role){
ValidatorUtils.validateEntity(role);
role.setCreateUserId(getUserId());
sysRoleService.saveRole(role);
return R.ok();
}
/**
* 修改角色
*/
......@@ -108,13 +108,13 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:update")
public R update(@RequestBody SysRoleEntity role){
ValidatorUtils.validateEntity(role);
role.setCreateUserId(getUserId());
sysRoleService.update(role);
return R.ok();
}
/**
* 删除角色
*/
......@@ -123,7 +123,7 @@ public class SysRoleController extends AbstractController {
@RequiresPermissions("sys:role:delete")
public R delete(@RequestBody Long[] roleIds){
sysRoleService.deleteBatch(roleIds);
return R.ok();
}
}
......@@ -50,14 +50,14 @@ public class SysUserController extends AbstractController {
@RequiresPermissions("sys:user:list")
public R list(@RequestParam Map<String, Object> params){
//只有超级管理员,才能查看所有管理员列表
// if(getUserId() != Constant.SUPER_ADMIN){
// params.put("createUserId", getUserId());
// }
if(getUserId() != Constant.SUPER_ADMIN){
params.put("createUserId", getUserId());
}
PageUtils page = sysUserService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 获取登录的用户信息
*/
......@@ -65,7 +65,7 @@ public class SysUserController extends AbstractController {
public R info(){
return R.ok().put("user", getUser());
}
/**
* 修改登录用户密码
*/
......@@ -73,21 +73,21 @@ public class SysUserController extends AbstractController {
@RequestMapping("/password")
public R password(@RequestBody PasswordForm form){
Assert.isBlank(form.getNewPassword(), "新密码不为能空");
//sha256加密
String password = new Sha256Hash(form.getPassword(), getUser().getSalt()).toHex();
//sha256加密
String newPassword = new Sha256Hash(form.getNewPassword(), getUser().getSalt()).toHex();
//更新密码
boolean flag = sysUserService.updatePassword(getUserId(), password, newPassword);
if(!flag){
return R.error("原密码不正确");
}
return R.ok();
}
/**
* 用户信息
*/
......@@ -95,14 +95,14 @@ public class SysUserController extends AbstractController {
@RequiresPermissions("sys:user:info")
public R info(@PathVariable("userId") Long userId){
SysUserEntity user = sysUserService.getById(userId);
//获取用户所属的角色列表
List<Long> roleIdList = sysUserRoleService.queryRoleIdList(userId);
user.setRoleIdList(roleIdList);
return R.ok().put("user", user);
}
/**
* 保存用户
*/
......@@ -111,13 +111,13 @@ public class SysUserController extends AbstractController {
@RequiresPermissions("sys:user:save")
public R save(@RequestBody SysUserEntity user){
ValidatorUtils.validateEntity(user, AddGroup.class);
user.setCreateUserId(getUserId());
sysUserService.saveUser(user);
return R.ok();
}
/**
* 修改用户
*/
......@@ -129,10 +129,10 @@ public class SysUserController extends AbstractController {
user.setCreateUserId(getUserId());
sysUserService.update(user);
return R.ok();
}
/**
* 删除用户
*/
......@@ -143,13 +143,13 @@ public class SysUserController extends AbstractController {
if(ArrayUtils.contains(userIds, 1L)){
return R.error("系统管理员不能删除");
}
if(ArrayUtils.contains(userIds, getUserId())){
return R.error("当前用户不能删除");
}
sysUserService.deleteBatch(userIds);
return R.ok();
}
}
......@@ -30,14 +30,14 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
private SysUserService sysUserService;
@Autowired
private SysRoleMenuService sysRoleMenuService;
@Override
public List<SysMenuEntity> queryListParentId(Long parentId, List<Long> menuIdList) {
List<SysMenuEntity> menuList = queryListParentId(parentId);
if(menuIdList == null){
return menuList;
}
List<SysMenuEntity> userMenuList = new ArrayList<>();
for(SysMenuEntity menu : menuList){
if(menuIdList.contains(menu.getMenuId())){
......@@ -60,10 +60,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
@Override
public List<SysMenuEntity> getUserMenuList(Long userId) {
//系统管理员,拥有最高权限
// if(userId == Constant.SUPER_ADMIN){
// return getAllMenuList(null);
// }
if(userId == Constant.SUPER_ADMIN){
return getAllMenuList(null);
}
//用户菜单列表
List<Long> menuIdList = sysUserService.queryAllMenuId(userId);
return getAllMenuList(menuIdList);
......@@ -85,7 +85,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
List<SysMenuEntity> menuList = queryListParentId(0L, menuIdList);
//递归获取子菜单
getMenuTreeList(menuList, menuIdList);
return menuList;
}
......@@ -94,7 +94,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
*/
private List<SysMenuEntity> getMenuTreeList(List<SysMenuEntity> menuList, List<Long> menuIdList){
List<SysMenuEntity> subMenuList = new ArrayList<SysMenuEntity>();
for(SysMenuEntity entity : menuList){
//目录
if(entity.getType() == Constant.MenuType.CATALOG.getValue()){
......@@ -102,7 +102,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuDao, SysMenuEntity> i
}
subMenuList.add(entity);
}
return subMenuList;
}
}
......@@ -87,7 +87,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
this.save(role);
//检查权限是否越权
checkPrems(role);
//checkPrems(role);
//保存角色与菜单关系
sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList());
......@@ -99,7 +99,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
this.updateById(role);
//检查权限是否越权
checkPrems(role);
//checkPrems(role);
//更新角色与菜单关系
sysRoleMenuService.saveOrUpdate(role.getRoleId(), role.getMenuIdList());
......@@ -129,9 +129,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleDao, SysRoleEntity> i
*/
private void checkPrems(SysRoleEntity role) {
//如果不是超级管理员,则需要判断角色的权限是否超过自己的权限
// if(role.getCreateUserId() == Constant.SUPER_ADMIN){
// return ;
// }
if(role.getCreateUserId() == Constant.SUPER_ADMIN){
return ;
}
//查询用户所拥有的菜单列表
List<Long> menuIdList = sysUserService.queryAllMenuId(role.getCreateUserId());
......
......@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.exception.RRException;
import io.office.common.utils.Constant;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.sys.dao.SysUserDao;
......@@ -84,10 +83,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
user.setPassword(new Sha256Hash(user.getPassword(), salt).toHex());
user.setSalt(salt);
this.save(user);
//检查角色是否越权
checkRole(user);
//checkRole(user);
//保存用户与角色关系
sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
}
......@@ -101,10 +100,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
user.setPassword(new Sha256Hash(user.getPassword(), user.getSalt()).toHex());
}
this.updateById(user);
//检查角色是否越权
checkRole(user);
//checkRole(user);
//保存用户与角色关系
sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
}
......@@ -121,7 +120,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
return this.update(userEntity,
new QueryWrapper<SysUserEntity>().eq("user_id", userId).eq("password", password));
}
/**
* 检查角色是否越权
*/
......@@ -130,10 +129,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
return;
}
//如果不是超级管理员,则需要判断用户的角色是否自己创建
// if(user.getCreateUserId() == Constant.SUPER_ADMIN){
// return ;
// }
//if(user.getCreateUserId() == Constant.SUPER_ADMIN){
// return ;
//}
//查询用户创建的角色列表
List<Long> roleIdList = sysRoleService.queryRoleIdList(user.getCreateUserId());
......@@ -142,4 +141,4 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
throw new RRException("新增用户所选角色,不是本人创建");
}
}
}
\ No newline at end of file
}
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