日期注解不生效问题 角色列表 差八小时 修复

This commit is contained in:
yuezhihang
2022-01-07 16:21:58 +08:00
parent 935cdf07ee
commit 6a4b807ecb
4 changed files with 17 additions and 5 deletions
@@ -8,6 +8,7 @@ import com.adc.da.login.util.UserUtils;
import com.adc.da.slrs.sarMenu.entity.SarMenu;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.slrs.sarRole.dao.TsRoleDao;
import com.adc.da.slrs.sarRole.entity.TsRoleMenuVO;
import com.adc.da.slrs.sarRole.entity.TsRoleResourceVO;
import com.adc.da.slrs.sarRole.service.ITsRoleService;
@@ -39,6 +40,8 @@ import java.util.List;
public class TsRoleController extends BaseController<TsRole> {
@Autowired
private ITsRoleService tsRoleService;
@Autowired
private TsRoleDao tsRoleDao;
@ApiOperation("查询所有角色")
@GetMapping
@@ -95,9 +98,14 @@ public class TsRoleController extends BaseController<TsRole> {
@ApiOperation("查询角色详情")
@GetMapping("/id")
public ResponseMessage<TsRole> getRoleById(@RequestParam String roleId){
TsRole tsRole=tsRoleService.getById(roleId);
// TsRole tsRole=tsRoleService.getById(roleId);
// if(tsRole.getParentId()!=null){
// TsRole parent=tsRoleService.getById(tsRole.getParentId());
// tsRole.setParent(parent.getName());
// }
TsRole tsRole=tsRoleDao.getAllDatas(roleId);
if(tsRole.getParentId()!=null){
TsRole parent=tsRoleService.getById(tsRole.getParentId());
TsRole parent=tsRoleDao.getAllDatas(tsRole.getParentId());
tsRole.setParent(parent.getName());
}
return Result.success(tsRole);
@@ -99,4 +99,7 @@ public interface TsRoleDao extends BaseMapper<TsRole> {
* @return List<String>
*/
List<String> getRootMenuIdsByRoleIds(List<String> roleIds);
@Select("select *,DATE_ADD(ts_role.operate_time,INTERVAL 8 HOUR) as operateTime from ts_role where ts_role.ID = #{roleId}")
TsRole getAllDatas(@Param("roleId") String roleId);
}
@@ -69,7 +69,7 @@ public class TsRole extends BaseEntity {
private String remarks;
@ApiModelProperty(value = "操作时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss",locale = "zh")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp operateTime;
@@ -89,13 +89,13 @@ public class TsRole extends BaseEntity {
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Timestamp modifyTime;
@@ -5,6 +5,7 @@ import com.adc.da.slrs.sarRole.entity.TsRole;
import com.adc.da.slrs.sarRole.entity.TsRoleMenuVO;
import com.adc.da.slrs.sarRole.entity.TsRoleResourceVO;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import java.util.List;