Commit 7e440353 authored by wzp's avatar wzp

修改bug

parent 85ff986c
......@@ -3,6 +3,9 @@ package cn.wisenergy.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.wisenergy.chnmuseum.party.model.TArea;
import java.util.List;
import java.util.Map;
/**
* <pre>
* 区域表 Mapper 接口
......@@ -13,4 +16,5 @@ import cn.wisenergy.chnmuseum.party.model.TArea;
*/
public interface TAreaMapper extends BaseMapper<TArea> {
List<Map<String,String>> languageInfo();
}
......@@ -16,4 +16,6 @@ import java.util.Map;
*/
public interface TOrganMapper extends BaseMapper<TOrgan> {
List<Map<String,Object>> selectArea();
TOrgan getById(String id);
}
......@@ -18,4 +18,6 @@ public interface TUserMapper extends BaseMapper<TUser> {
TUser selectByUsername(String userName);
List<TUser> selectList(String userName);
TUser getById(String id);
}
......@@ -89,14 +89,20 @@ public class TOrgan implements Serializable {
@ApiModelProperty("级别")
@TableField("level")
@NotNull(message = "区域不能为空", groups = {Add.class, Update.class})
@NotNull(message = "级别不能为空", groups = {Add.class, Update.class})
private Integer level;
@ApiModelProperty("下级机构")
@TableField(exist = false)
private List<TOrgan> children;
@ApiModelProperty("上级机构名")
@TableField(exist = false)
private String parentName;
@ApiModelProperty("区域名")
@TableField(exist = false)
private String areaName;
}
......@@ -126,6 +126,10 @@ public class TUser implements Serializable {
@TableField("audit_status")
private String auditStatus;
@ApiModelProperty("区域")
@TableField("area_id")
private String areaId;
@ApiModelProperty("机构名称")
@TableField(exist = false)
private String orgName;
......@@ -138,6 +142,10 @@ public class TUser implements Serializable {
@TableField(exist = false)
private String password;
@ApiModelProperty("区域名")
@TableField(exist = false)
private String areaName;
@TableField(exist = false)
private String jwtToken;
......
......@@ -18,4 +18,6 @@ public interface TOrganService extends IService<TOrgan> {
List<TOrgan> getTree();
boolean batchUpload(List excelList);
TOrgan selectById(String id);
}
......@@ -17,4 +17,6 @@ public interface TUserService extends IService<TUser> {
TUser selectByUsername(String userName);
Page<TUser> selectList(Page<TUser> page, String userName);
TUser selectById(String id);
}
......@@ -16,6 +16,7 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -31,7 +32,7 @@ import java.util.stream.Collectors;
public class TAreaServiceImpl extends ServiceImpl<TAreaMapper, TArea> implements TAreaService {
@Resource
private TAreaMapper tAreaMapper;
private TAreaMapper areaMapper;
@Override
public List<TArea> getAreaTree() {
......@@ -51,4 +52,8 @@ public class TAreaServiceImpl extends ServiceImpl<TAreaMapper, TArea> implements
list = list.stream().filter(o -> o.getType().equals("P")).collect(Collectors.toList());
return list;
}
public List<Map<String,String>> languageInfo() {
return areaMapper.languageInfo();
}
}
......@@ -88,4 +88,9 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
flag = saveBatch(list);
return flag;
}
@Override
public TOrgan selectById(String id) {
return organMapper.getById(id);
}
}
......@@ -37,4 +37,9 @@ public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements
public Page<TUser> selectList(Page<TUser> page, String userName) {
return page.setRecords(tUserMapper.selectList(userName));
}
@Override
public TUser selectById(String id) {
return tUserMapper.getById(id);
}
}
......@@ -13,6 +13,7 @@ import cn.wisenergy.chnmuseum.party.service.ExhibitionBoardService;
import cn.wisenergy.chnmuseum.party.service.RunLogService;
import cn.wisenergy.chnmuseum.party.service.impl.EmployeeServiceImpl;
import cn.wisenergy.chnmuseum.party.service.impl.RunLogServiceImpl;
import cn.wisenergy.chnmuseum.party.service.impl.TAreaServiceImpl;
import cn.wisenergy.chnmuseum.party.service.impl.TUserServiceImpl;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.alibaba.fastjson.JSONObject;
......@@ -38,6 +39,8 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Slf4j
......@@ -62,6 +65,9 @@ public class ChinaMobileRestApiController extends BaseController {
@Resource
private SysLogController sysLogController;
@Resource
private TAreaServiceImpl areaService;
@Resource
private ExhibitionBoardService exhibitionBoardService;
......@@ -325,6 +331,28 @@ public class ChinaMobileRestApiController extends BaseController {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
}
/**
* 查询语言列表
*/
@ApiOperation(value = "查询语言列表", notes = "查询语言列表")
@PostMapping(value = "/language/info")
public ResponseEntity<JSONObject> languageInfo() {
JSONObject resultMap = new JSONObject();
try {
List<Map<String, String>> list = areaService.languageInfo();
resultMap.put("resultCode", 200);
resultMap.put("message", "成功");
resultMap.put("data", list);
return ResponseEntity.status(HttpStatus.OK).body(resultMap);
} catch (Exception e) {
resultMap.put("resultCode", 500);
resultMap.put("message", "失败");
resultMap.put("data", "");
}
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resultMap);
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
......
......@@ -200,7 +200,7 @@ public class LoginController {
public ResponseEntity<JSONObject> logout(@RequestHeader(value = "token") String token) {
try {
if (StringUtils.isNotBlank(token)) {
SecurityUtils.getSubject().logout();
// SecurityUtils.getSubject().logout();
this.stringRedisTemplate.delete(SHIRO_JWT_TOKEN + token);
}
JSONObject resultMap = new JSONObject();
......
......@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
......@@ -35,6 +36,7 @@ import java.util.Map;
@RestController
@RequestMapping("/sysLog")
@Api(tags = {"日志管理接口"})
public class SysLogController extends BaseController {
@Resource
......
......@@ -162,7 +162,7 @@ public class TOrganController extends BaseController {
@RequiresPermissions("/organ/getById")
@MethodLog(operModule = OperModule.ORG,operType = OperType.SELECT)
public Map<String, Object> getById(String id) {
TOrgan tOrgan = tOrganService.getById(id);
TOrgan tOrgan = tOrganService.selectById(id);
return getResult(tOrgan);
}
......
......@@ -126,7 +126,7 @@ public class TUserController extends BaseController {
@RequiresPermissions("/user/getById")
@MethodLog(operModule = OperModule.USER, operType = OperType.SELECT)
public Map<String, Object> getById(String id) {
TUser tUser = userService.getById(id);
TUser tUser = userService.selectById(id);
List<Role> list = roleService.selectRoleByUserId(id);
tUser.setRoleList(list);
return getResult(tUser);
......
......@@ -22,4 +22,7 @@
id, name, sname, code, type, parent_id, sort_position, longitude, latitude, full_name, remarks
</sql>
<select id="languageInfo" resultType="java.util.HashMap">
select id,name,code from t_language
</select>
</mapper>
......@@ -4,17 +4,19 @@
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.TOrgan">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="parent_id" property="parentId" />
<result column="is_deleted" property="isDeleted" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="area_id" property="areaId" />
<result column="icon" property="icon" />
<result column="remarks" property="remarks" />
<result column="level" property="level" />
</resultMap>
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="parent_id" property="parentId"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="area_id" property="areaId"/>
<result column="icon" property="icon"/>
<result column="remarks" property="remarks"/>
<result column="level" property="level"/>
<result column="parent_name" property="parentName"/>
<result column="area_name" property="areaName"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
......@@ -26,4 +28,12 @@
select full_name name,id from t_area
</select>
<select id="getById" resultMap="BaseResultMap">
select o.* ,r.`name` parent_name,a.full_name area_name
from t_organ o
left join t_organ r on o.parent_id = r.id
left join t_area a on o.area_id = a.id
where o.id = #{id}
</select>
</mapper>
......@@ -23,7 +23,9 @@
<result column="real_name" property="realName"/>
<result column="type" property="type"/>
<result column="audit_status" property="auditStatus"/>
<result column="area_id" property="areaId"/>
<result column="org_name" property="orgName"/>
<result column="area_name" property="areaName"/>
<collection fetchType="eager" property="roleList" ofType="cn.wisenergy.chnmuseum.party.model.Role"
select="selectRoles" column="user_name"/>
</resultMap>
......@@ -48,16 +50,26 @@
</sql>
<select id="selectByUsername" resultMap="BaseResultMap">
select u.*,o.name org_name
select u.*,o.name org_name,a.full_name area_name
from t_user u
left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id
where u.user_name =#{userName}
</select>
<select id="getById" resultMap="BaseResultMap">
select u.*,o.name org_name,a.full_name area_name
from t_user u
left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id
where u.id =#{id}
</select>
<select id="selectList" resultMap="BaseResultMap">
select u.*,o.name org_name
select u.*,o.name org_name,a.full_name area_name
from t_user u
left join t_organ o on o.id = u.org_id
left join t_area a on u.area_id = a.id
<if test=" username != null and username != '' ">
where u.user_name LIKE concat('%', #{userName}, '%')
</if>
......
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