提交 5a4a8808 authored 作者: 宋文杰's avatar 宋文杰

fix(attendance): fix bug to the province office can see the attendance of city office

上级 0b7d7677
......@@ -4,10 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 应急事件表
......@@ -65,7 +67,8 @@ private static final long serialVersionUID = 1L;
/**
* 上报时间
*/
private LocalDateTime reportingTime;
@JsonFormat(timezone = "GMT+8")
private Date reportingTime;
/**
* 状态
*/
......
......@@ -99,5 +99,16 @@ public class DeptController extends BaseController {
return new R(deptService.updateDeptById(dept));
}
/**
* @Description: 判断是否是省厅
* @Param: [deptId]
* @return: com.elephant.framework.galaxy.aroad.response.R
* @Author: songwenjie
* @Date: 2019/5/9
*/
@GetMapping("/isProvince/{deptId}")
public R isProvince(@PathVariable Integer deptId){
return new R(deptService.isProvince(deptId));
}
}
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.time.LocalDateTime;
import java.io.Serializable;
......@@ -15,6 +17,7 @@ import java.io.Serializable;
* @author wangjian
* @since 2019-02-21
*/
@Data
@TableName("sys_dept")
public class Dept extends Model<Dept> {
......@@ -52,87 +55,16 @@ public class Dept extends Model<Dept> {
private Integer tenantId;
/**
* 省厅|市局|省厅部门|市局部门
*/
private String type;
public Integer getDeptId() {
return deptId;
}
public void setDeptId(Integer deptId) {
this.deptId = deptId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Integer getTenantId() {
return tenantId;
}
public void setTenantId(Integer tenantId) {
this.tenantId = tenantId;
}
@Override
protected Serializable pkVal() {
return this.deptId;
}
@Override
public String toString() {
return "Dept{" +
"deptId=" + deptId +
", name=" + name +
", sort=" + sort +
", createTime=" + createTime +
", updateTime=" + updateTime +
", delFlag=" + delFlag +
", parentId=" + parentId +
", tenantId=" + tenantId +
"}";
}
}
......@@ -63,4 +63,13 @@ public interface DeptService extends IService<Dept> {
*/
String getDeptName(int deptId);
/**
* @Description: 判断是否是省厅
* @Param: [deptId]
* @return: boolean
* @Author: songwenjie
* @Date: 2019/5/9
*/
boolean isProvince(int deptId);
}
......@@ -208,4 +208,23 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
}
return getDeptName(dept.getParentId());
}
/**
* @Description: 判断是否是省厅
* @Param: [deptId]
* @return: boolean
* @Author: songwenjie
* @Date: 2019/5/9
*/
public boolean isProvince(int deptId){
Dept dept = baseMapper.getDeptById(deptId)
.stream()
.findFirst()
.get();
String type = dept.getType();
if(type.equals("省厅") || type.equals("省厅部门")){
return true;
}
return false;
}
}
......@@ -25,7 +25,7 @@
</select>
<select id="getDeptById" resultMap="BaseResultMap">
select dept_id,name,parent_id from sys_dept
select dept_id,name,parent_id,type from sys_dept
where del_flag = 0 and dept_id = #{deptId}
</select>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论