15 changed files with 965 additions and 5 deletions
@ -0,0 +1,88 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.AdminImgDTO; |
|||
import com.elink.esua.epdc.service.AdminImgService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 图片表 图片表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("adminimg") |
|||
public class AdminImgController { |
|||
|
|||
@Autowired |
|||
private AdminImgService adminImgService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<AdminImgDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<AdminImgDTO> page = adminImgService.page(params); |
|||
return new Result<PageData<AdminImgDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<AdminImgDTO> get(@PathVariable("id") String id){ |
|||
AdminImgDTO data = adminImgService.get(id); |
|||
return new Result<AdminImgDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody AdminImgDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
adminImgService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody AdminImgDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
adminImgService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
adminImgService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.SysDeptInfoDTO; |
|||
import com.elink.esua.epdc.service.SysDeptInfoService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 部门信息表 组织信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("sysdeptinfo") |
|||
public class SysDeptInfoController { |
|||
|
|||
@Autowired |
|||
private SysDeptInfoService sysDeptInfoService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<SysDeptInfoDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<SysDeptInfoDTO> page = sysDeptInfoService.page(params); |
|||
return new Result<PageData<SysDeptInfoDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<SysDeptInfoDTO> get(@PathVariable("id") String id){ |
|||
SysDeptInfoDTO data = sysDeptInfoService.get(id); |
|||
return new Result<SysDeptInfoDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody SysDeptInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
sysDeptInfoService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody SysDeptInfoDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
sysDeptInfoService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
sysDeptInfoService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.entity.AdminImgEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 图片表 图片表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
@Mapper |
|||
public interface AdminImgDao extends BaseDao<AdminImgEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.entity.SysDeptInfoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 部门信息表 组织信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
@Mapper |
|||
public interface SysDeptInfoDao extends BaseDao<SysDeptInfoEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 图片表 图片表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_admin_img") |
|||
public class AdminImgEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 引用ID |
|||
*/ |
|||
private String referenceId; |
|||
|
|||
/** |
|||
* 图片地址 |
|||
*/ |
|||
private String imgUrl; |
|||
|
|||
/** |
|||
* 图片类型lllll |
|||
*/ |
|||
private String imgType; |
|||
|
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 部门信息表 组织信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("sys_dept_info") |
|||
public class SysDeptInfoEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private Long deptId; |
|||
|
|||
/** |
|||
* 概况介绍 |
|||
*/ |
|||
private String introduction; |
|||
|
|||
/** |
|||
* 社区数量 |
|||
*/ |
|||
private Integer communityNum; |
|||
|
|||
/** |
|||
* 网格数量 |
|||
*/ |
|||
private Integer gridNum; |
|||
|
|||
/** |
|||
* 网格员数量 |
|||
*/ |
|||
private Integer gridmanNum; |
|||
|
|||
/** |
|||
* 党员数量 |
|||
*/ |
|||
private Integer partyMemberNum; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
|
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
/** |
|||
* 辖区面积 |
|||
*/ |
|||
private String acreage; |
|||
|
|||
} |
|||
@ -0,0 +1,107 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.AdminImgDTO; |
|||
import com.elink.esua.epdc.entity.AdminImgEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 图片表 图片表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
public interface AdminImgService extends BaseService<AdminImgEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<AdminImgDTO> |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
PageData<AdminImgDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<AdminImgDTO> |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
List<AdminImgDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return AdminImgDTO |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
AdminImgDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
void save(AdminImgDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
void update(AdminImgDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
|
|||
|
|||
/*** |
|||
* 根据类型 +引用ID |
|||
* @param imgType |
|||
* @param referenceId |
|||
* @return com.elink.esua.epdc.dto.AdminImgDTO |
|||
* @author qushutong |
|||
* @date 2021/8/10 17:20 |
|||
*/ |
|||
AdminImgDTO getDtoByReference(String imgType,String referenceId); |
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.SysDeptInfoDTO; |
|||
import com.elink.esua.epdc.entity.SysDeptInfoEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 部门信息表 组织信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
public interface SysDeptInfoService extends BaseService<SysDeptInfoEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<SysDeptInfoDTO> |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
PageData<SysDeptInfoDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<SysDeptInfoDTO> |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
List<SysDeptInfoDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return SysDeptInfoDTO |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
SysDeptInfoDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
void save(SysDeptInfoDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
void update(SysDeptInfoDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* 根据关联deptID 查询 |
|||
* |
|||
* @param deptId |
|||
* @return SysDeptInfoDTO |
|||
* @author generator |
|||
* @date 2021-08-10 |
|||
*/ |
|||
SysDeptInfoDTO getDeptInfoByDeptID(String deptId); |
|||
|
|||
} |
|||
@ -0,0 +1,110 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.dao.AdminImgDao; |
|||
import com.elink.esua.epdc.dto.AdminImgDTO; |
|||
import com.elink.esua.epdc.entity.AdminImgEntity; |
|||
import com.elink.esua.epdc.entity.SysDeptInfoEntity; |
|||
import com.elink.esua.epdc.service.AdminImgService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 图片表 图片表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
@Service |
|||
public class AdminImgServiceImpl extends BaseServiceImpl<AdminImgDao, AdminImgEntity> implements AdminImgService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<AdminImgDTO> page(Map<String, Object> params) { |
|||
IPage<AdminImgEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, AdminImgDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<AdminImgDTO> list(Map<String, Object> params) { |
|||
List<AdminImgEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, AdminImgDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<AdminImgEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<AdminImgEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public AdminImgDTO get(String id) { |
|||
AdminImgEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, AdminImgDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(AdminImgDTO dto) { |
|||
AdminImgEntity entity = ConvertUtils.sourceToTarget(dto, AdminImgEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(AdminImgDTO dto) { |
|||
AdminImgEntity entity = ConvertUtils.sourceToTarget(dto, AdminImgEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public AdminImgDTO getDtoByReference(String imgType, String referenceId) { |
|||
QueryWrapper<AdminImgEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(referenceId), FieldConstant.REFERENCE_ID, referenceId); |
|||
wrapper.eq(StringUtils.isNotBlank(imgType), FieldConstant.IMG_TYPE, imgType); |
|||
return ConvertUtils.sourceToTarget(baseDao.selectOne(wrapper),AdminImgDTO.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,109 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.dao.SysDeptInfoDao; |
|||
import com.elink.esua.epdc.dto.SysDeptInfoDTO; |
|||
import com.elink.esua.epdc.entity.SysDeptInfoEntity; |
|||
import com.elink.esua.epdc.service.SysDeptInfoService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 部门信息表 组织信息表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2021-08-10 |
|||
*/ |
|||
@Service |
|||
public class SysDeptInfoServiceImpl extends BaseServiceImpl<SysDeptInfoDao, SysDeptInfoEntity> implements SysDeptInfoService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<SysDeptInfoDTO> page(Map<String, Object> params) { |
|||
IPage<SysDeptInfoEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, SysDeptInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<SysDeptInfoDTO> list(Map<String, Object> params) { |
|||
List<SysDeptInfoEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, SysDeptInfoDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<SysDeptInfoEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<SysDeptInfoEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public SysDeptInfoDTO get(String id) { |
|||
SysDeptInfoEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, SysDeptInfoDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(SysDeptInfoDTO dto) { |
|||
SysDeptInfoEntity entity = ConvertUtils.sourceToTarget(dto, SysDeptInfoEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(SysDeptInfoDTO dto) { |
|||
SysDeptInfoEntity entity = ConvertUtils.sourceToTarget(dto, SysDeptInfoEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public SysDeptInfoDTO getDeptInfoByDeptID(String deptId) { |
|||
QueryWrapper<SysDeptInfoEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(deptId), FieldConstant.DEPT_ID, deptId); |
|||
SysDeptInfoEntity sysDeptInfoEntity = baseDao.selectOne(wrapper); |
|||
return ConvertUtils.sourceToTarget(sysDeptInfoEntity,SysDeptInfoDTO.class); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.dao.AdminImgDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.AdminImgEntity" id="adminImgMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="referenceId" column="REFERENCE_ID"/> |
|||
<result property="imgUrl" column="IMG_URL"/> |
|||
<result property="imgType" column="IMG_TYPE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,26 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.elink.esua.epdc.dao.SysDeptInfoDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.SysDeptInfoEntity" id="sysDeptInfoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="deptId" column="DEPT_ID"/> |
|||
<result property="introduction" column="INTRODUCTION"/> |
|||
<result property="communityNum" column="COMMUNITY_NUM"/> |
|||
<result property="gridNum" column="GRID_NUM"/> |
|||
<result property="gridmanNum" column="GRIDMAN_NUM"/> |
|||
<result property="partyMemberNum" column="PARTY_MEMBER_NUM"/> |
|||
<result property="longitude" column="LONGITUDE"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
<result property="acreage" column="ACREAGE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -1 +1 @@ |
|||
Subproject commit 5f3795652ce1dddd3bfced7410ffb36036ed5bbf |
|||
Subproject commit 57330e4f0947080d545ed8c2c1003636cd9be806 |
|||
@ -1 +1 @@ |
|||
Subproject commit ffc7323ae85c274afed21d90e2cd744c2801a1a8 |
|||
Subproject commit b2a4ab3cff9f848c77e7ec6b428321639270f734 |
|||
Loading…
Reference in new issue