17 changed files with 1300 additions and 0 deletions
@ -0,0 +1,102 @@ |
|||||
|
/** |
||||
|
* 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.epmet.resi.partymember.dto.partymember; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 党员风采 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcPartymemberStyleDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 楼栋主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 党员姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 主要事迹 |
||||
|
*/ |
||||
|
private String mainDeed; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0未删除、1已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
private List<String> imageList; |
||||
|
|
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
/** |
||||
|
* 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.epmet.resi.partymember.dto.partymember; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 党员风采图片 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcPartymemberStyleImageDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 唯一标识 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采ID |
||||
|
*/ |
||||
|
private String styleId; |
||||
|
|
||||
|
/** |
||||
|
* 图片地址 |
||||
|
*/ |
||||
|
private String imageUrl; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.resi.partymember.dto.partymember.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/11/19 9:49 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class PartyMemberStyleFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 4743261460276449408L; |
||||
|
private String agencyId; |
||||
|
private String gridId; |
||||
|
private String name; |
||||
|
private String mainDeed; |
||||
|
private Integer pageNo; |
||||
|
private Integer pageSize; |
||||
|
} |
@ -0,0 +1,103 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.modules.partymember.excel.IcPartymemberStyleExcel; |
||||
|
import com.epmet.modules.partymember.service.IcPartymemberStyleService; |
||||
|
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; |
||||
|
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; |
||||
|
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; |
||||
|
import java.util.concurrent.atomic.AtomicInteger; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 党员风采 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icpartymemberstyle") |
||||
|
public class IcPartymemberStyleController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcPartymemberStyleService icPartymemberStyleService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<IcPartymemberStyleDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcPartymemberStyleDTO> page = icPartymemberStyleService.page(params); |
||||
|
return new Result<PageData<IcPartymemberStyleDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("detail") |
||||
|
public Result<IcPartymemberStyleDTO> get(@RequestBody IcPartymemberStyleDTO dto){ |
||||
|
IcPartymemberStyleDTO data = icPartymemberStyleService.get(dto.getId()); |
||||
|
return new Result<IcPartymemberStyleDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("save") |
||||
|
public Result save(@RequestBody IcPartymemberStyleDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icPartymemberStyleService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("delete") |
||||
|
public Result delete(@RequestBody IcPartymemberStyleDTO dto){ |
||||
|
//效验数据
|
||||
|
icPartymemberStyleService.delete(dto.getId()); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("export") |
||||
|
public void export(@RequestBody PartyMemberStyleFormDTO formDTO, HttpServletResponse response) throws Exception { |
||||
|
List<IcPartymemberStyleDTO> list = icPartymemberStyleService.search(formDTO).getList(); |
||||
|
AtomicInteger i = new AtomicInteger(NumConstant.ONE); |
||||
|
List<IcPartymemberStyleExcel> result = list.stream().map(item -> { |
||||
|
IcPartymemberStyleExcel excel = new IcPartymemberStyleExcel(); |
||||
|
excel.setIndex(i.getAndIncrement()); |
||||
|
excel.setGridName(item.getGridName()); |
||||
|
excel.setName(item.getName()); |
||||
|
excel.setMainDeed(item.getMainDeed()); |
||||
|
return excel; |
||||
|
}).collect(Collectors.toList()); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, IcPartymemberStyleExcel.class); |
||||
|
} |
||||
|
|
||||
|
@PostMapping("list") |
||||
|
public Result<PageData<IcPartymemberStyleDTO>> search(@RequestBody PartyMemberStyleFormDTO formDTO) { |
||||
|
return new Result<PageData<IcPartymemberStyleDTO>>().ok(icPartymemberStyleService.search(formDTO)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,94 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ExcelUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.AssertUtils; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.commons.tools.validator.group.AddGroup; |
||||
|
import com.epmet.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.epmet.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.epmet.modules.partymember.excel.IcPartymemberStyleImageExcel; |
||||
|
import com.epmet.modules.partymember.service.IcPartymemberStyleImageService; |
||||
|
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleImageDTO; |
||||
|
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 generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("icpartymemberstyleimage") |
||||
|
public class IcPartymemberStyleImageController { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcPartymemberStyleImageService icPartymemberStyleImageService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<IcPartymemberStyleImageDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcPartymemberStyleImageDTO> page = icPartymemberStyleImageService.page(params); |
||||
|
return new Result<PageData<IcPartymemberStyleImageDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<IcPartymemberStyleImageDTO> get(@PathVariable("id") String id){ |
||||
|
IcPartymemberStyleImageDTO data = icPartymemberStyleImageService.get(id); |
||||
|
return new Result<IcPartymemberStyleImageDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody IcPartymemberStyleImageDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
icPartymemberStyleImageService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody IcPartymemberStyleImageDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
icPartymemberStyleImageService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
icPartymemberStyleImageService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<IcPartymemberStyleImageDTO> list = icPartymemberStyleImageService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, IcPartymemberStyleImageExcel.class); |
||||
|
} |
||||
|
|
||||
|
} |
@ -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.epmet.modules.partymember.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcPartymemberStyleDao extends BaseDao<IcPartymemberStyleEntity> { |
||||
|
|
||||
|
} |
@ -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.epmet.modules.partymember.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采图片 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface IcPartymemberStyleImageDao extends BaseDao<IcPartymemberStyleImageEntity> { |
||||
|
|
||||
|
} |
@ -0,0 +1,63 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_partymember_style") |
||||
|
public class IcPartymemberStyleEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 党员姓名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
/** |
||||
|
* 主要事迹 |
||||
|
*/ |
||||
|
private String mainDeed; |
||||
|
|
||||
|
} |
@ -0,0 +1,103 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采图片 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("ic_partymember_style_image") |
||||
|
public class IcPartymemberStyleImageEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
@TableId(type = IdType.UUID) |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采ID |
||||
|
*/ |
||||
|
private String styleId; |
||||
|
|
||||
|
/** |
||||
|
* 图片地址 |
||||
|
*/ |
||||
|
private String imageUrl; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建者 |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 修改者 |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT_UPDATE) |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 修改时间 |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT_UPDATE) |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* 是否已删除(0-未删除,1-已删除) |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private String delFlag; |
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcPartymemberStyleExcel { |
||||
|
|
||||
|
@Excel(name = "序号") |
||||
|
private Integer index; |
||||
|
|
||||
|
@Excel(name = "党员姓名") |
||||
|
private String name; |
||||
|
|
||||
|
@Excel(name = "所属网格") |
||||
|
private String gridName; |
||||
|
|
||||
|
@Excel(name = "主要事迹") |
||||
|
private String mainDeed; |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采图片 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcPartymemberStyleImageExcel { |
||||
|
|
||||
|
@Excel(name = "唯一标识") |
||||
|
private String id; |
||||
|
|
||||
|
@Excel(name = "客户ID") |
||||
|
private String customerId; |
||||
|
|
||||
|
@Excel(name = "党员风采ID") |
||||
|
private String styleId; |
||||
|
|
||||
|
@Excel(name = "图片地址") |
||||
|
private String imageUrl; |
||||
|
|
||||
|
@Excel(name = "排序") |
||||
|
private Integer sort; |
||||
|
|
||||
|
@Excel(name = "删除标识 0.未删除 1.已删除") |
||||
|
private Integer delFlag; |
||||
|
|
||||
|
@Excel(name = "乐观锁") |
||||
|
private Integer revision; |
||||
|
|
||||
|
@Excel(name = "创建人") |
||||
|
private String createdBy; |
||||
|
|
||||
|
@Excel(name = "创建时间") |
||||
|
private Date createdTime; |
||||
|
|
||||
|
@Excel(name = "更新人") |
||||
|
private String updatedBy; |
||||
|
|
||||
|
@Excel(name = "更新时间") |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,113 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity; |
||||
|
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleImageDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采图片 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
public interface IcPartymemberStyleImageService extends BaseService<IcPartymemberStyleImageEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcPartymemberStyleImageDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
PageData<IcPartymemberStyleImageDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcPartymemberStyleImageDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
List<IcPartymemberStyleImageDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcPartymemberStyleImageDTO |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
IcPartymemberStyleImageDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
void save(IcPartymemberStyleImageDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
void update(IcPartymemberStyleImageDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除党员风采图片 |
||||
|
* @Param styleId |
||||
|
* @Return |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/11/19 10:14 |
||||
|
*/ |
||||
|
void deleteByStyleId(String styleId); |
||||
|
|
||||
|
/** |
||||
|
* 获取党员风采图片 |
||||
|
* @Param styleId |
||||
|
* @Return {@link List< String>} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/11/19 10:40 |
||||
|
*/ |
||||
|
List<String> getByStyleId(String styleId); |
||||
|
} |
@ -0,0 +1,95 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; |
||||
|
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; |
||||
|
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
public interface IcPartymemberStyleService extends BaseService<IcPartymemberStyleEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcPartymemberStyleDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
PageData<IcPartymemberStyleDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcPartymemberStyleDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
List<IcPartymemberStyleDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return IcPartymemberStyleDTO |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
IcPartymemberStyleDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
void save(IcPartymemberStyleDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-11-18 |
||||
|
*/ |
||||
|
void delete(String id); |
||||
|
|
||||
|
/** |
||||
|
* 查询列表 |
||||
|
* @Param formDTO |
||||
|
* @Return {@link PageData<IcPartymemberStyleDTO>} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/11/19 9:30 |
||||
|
*/ |
||||
|
PageData<IcPartymemberStyleDTO> search(PartyMemberStyleFormDTO formDTO); |
||||
|
} |
@ -0,0 +1,137 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.modules.partymember.dao.IcPartymemberStyleImageDao; |
||||
|
import com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity; |
||||
|
import com.epmet.modules.partymember.service.IcPartymemberStyleImageService; |
||||
|
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleImageDTO; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采图片 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcPartymemberStyleImageServiceImpl extends BaseServiceImpl<IcPartymemberStyleImageDao, IcPartymemberStyleImageEntity> implements IcPartymemberStyleImageService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcPartymemberStyleImageDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcPartymemberStyleImageEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcPartymemberStyleImageDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcPartymemberStyleImageDTO> list(Map<String, Object> params) { |
||||
|
List<IcPartymemberStyleImageEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcPartymemberStyleImageDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcPartymemberStyleImageEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcPartymemberStyleImageEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcPartymemberStyleImageDTO get(String id) { |
||||
|
IcPartymemberStyleImageEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, IcPartymemberStyleImageDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcPartymemberStyleImageDTO dto) { |
||||
|
IcPartymemberStyleImageEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleImageEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(IcPartymemberStyleImageDTO dto) { |
||||
|
IcPartymemberStyleImageEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleImageEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除党员风采图片 |
||||
|
* |
||||
|
* @param styleId |
||||
|
* @Param styleId |
||||
|
* @Return |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/11/19 10:14 |
||||
|
*/ |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void deleteByStyleId(String styleId) { |
||||
|
LambdaQueryWrapper<IcPartymemberStyleImageEntity> wrapper = new LambdaQueryWrapper<>(); |
||||
|
wrapper.eq(IcPartymemberStyleImageEntity::getStyleId, styleId); |
||||
|
baseDao.delete(wrapper); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取党员风采图片 |
||||
|
* |
||||
|
* @param styleId |
||||
|
* @Param styleId |
||||
|
* @Return {@link List< String>} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/11/19 10:40 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<String> getByStyleId(String styleId) { |
||||
|
LambdaQueryWrapper<IcPartymemberStyleImageEntity> wrapper = new LambdaQueryWrapper<>(); |
||||
|
wrapper.eq(IcPartymemberStyleImageEntity::getStyleId, styleId); |
||||
|
wrapper.orderByAsc(IcPartymemberStyleImageEntity::getSort); |
||||
|
List<IcPartymemberStyleImageEntity> list = baseDao.selectList(wrapper); |
||||
|
return list.stream().map(IcPartymemberStyleImageEntity::getImageUrl).collect(Collectors.toList()); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,156 @@ |
|||||
|
/** |
||||
|
* 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.epmet.modules.partymember.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
||||
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.modules.partymember.dao.IcPartymemberStyleDao; |
||||
|
import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; |
||||
|
import com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity; |
||||
|
import com.epmet.modules.partymember.service.IcPartymemberStyleImageService; |
||||
|
import com.epmet.modules.partymember.service.IcPartymemberStyleService; |
||||
|
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; |
||||
|
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; |
||||
|
import com.github.pagehelper.PageHelper; |
||||
|
import com.github.pagehelper.PageInfo; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.concurrent.atomic.AtomicInteger; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* 党员风采 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-11-18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymemberStyleDao, IcPartymemberStyleEntity> implements IcPartymemberStyleService { |
||||
|
|
||||
|
@Resource |
||||
|
private IcPartymemberStyleImageService icPartymemberStyleImageService; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcPartymemberStyleDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcPartymemberStyleEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcPartymemberStyleDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcPartymemberStyleDTO> list(Map<String, Object> params) { |
||||
|
List<IcPartymemberStyleEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcPartymemberStyleDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcPartymemberStyleEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcPartymemberStyleEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public IcPartymemberStyleDTO get(String id) { |
||||
|
IcPartymemberStyleEntity entity = baseDao.selectById(id); |
||||
|
IcPartymemberStyleDTO dto = ConvertUtils.sourceToTarget(entity, IcPartymemberStyleDTO.class); |
||||
|
dto.setImageList(icPartymemberStyleImageService.getByStyleId(id)); |
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(IcPartymemberStyleDTO dto) { |
||||
|
IcPartymemberStyleEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleEntity.class); |
||||
|
if (StringUtils.isBlank(entity.getId())) { |
||||
|
insert(entity); |
||||
|
} else { |
||||
|
updateById(entity); |
||||
|
} |
||||
|
//删除原有的照片
|
||||
|
icPartymemberStyleImageService.deleteByStyleId(entity.getId()); |
||||
|
//保存新的照片
|
||||
|
if (CollectionUtils.isNotEmpty(dto.getImageList())) { |
||||
|
AtomicInteger i = new AtomicInteger(NumConstant.ZERO); |
||||
|
List<IcPartymemberStyleImageEntity> list = dto.getImageList().stream().map(item -> { |
||||
|
IcPartymemberStyleImageEntity e = new IcPartymemberStyleImageEntity(); |
||||
|
e.setStyleId(entity.getId()); |
||||
|
e.setImageUrl(item); |
||||
|
e.setSort(i.getAndIncrement()); |
||||
|
return e; |
||||
|
}).collect(Collectors.toList()); |
||||
|
icPartymemberStyleImageService.insertBatch(list); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String id) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询列表 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @Param formDTO |
||||
|
* @Return {@link PageData<IcPartymemberStyleDTO>} |
||||
|
* @Author zhaoqifeng |
||||
|
* @Date 2021/11/19 9:30 |
||||
|
*/ |
||||
|
@Override |
||||
|
public PageData<IcPartymemberStyleDTO> search(PartyMemberStyleFormDTO formDTO) { |
||||
|
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); |
||||
|
//分页查询
|
||||
|
LambdaQueryWrapper<IcPartymemberStyleEntity> wrapper = new LambdaQueryWrapper<>(); |
||||
|
wrapper.eq(IcPartymemberStyleEntity::getAgencyId, formDTO.getAgencyId()); |
||||
|
wrapper.eq(StringUtils.isNotBlank(formDTO.getGridId()), IcPartymemberStyleEntity::getGridId, formDTO.getGridId()); |
||||
|
wrapper.like(StringUtils.isNotBlank(formDTO.getName()), IcPartymemberStyleEntity::getName, formDTO.getName()); |
||||
|
wrapper.like(StringUtils.isNotBlank(formDTO.getMainDeed()), IcPartymemberStyleEntity::getMainDeed, formDTO.getMainDeed()); |
||||
|
List<IcPartymemberStyleEntity> list = baseDao.selectList(wrapper); |
||||
|
List<IcPartymemberStyleDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartymemberStyleDTO.class); |
||||
|
PageInfo<IcPartymemberStyleDTO> pageInfo = new PageInfo<>(dtoList); |
||||
|
//设置网格名
|
||||
|
dtoList.forEach(item -> { |
||||
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); |
||||
|
item.setGridName(gridInfo.getGridName()); |
||||
|
}); |
||||
|
return new PageData<>(dtoList, pageInfo.getTotal()); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
<?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.epmet.modules.partymember.dao.IcPartymemberStyleDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.modules.partymember.entity.IcPartymemberStyleEntity" id="icPartymemberStyleMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="agencyId" column="AGENCY_ID"/> |
||||
|
<result property="gridId" column="GRID_ID"/> |
||||
|
<result property="name" column="NAME"/> |
||||
|
<result property="mainDeed" column="MAIN_DEED"/> |
||||
|
<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,21 @@ |
|||||
|
<?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.epmet.modules.partymember.dao.IcPartymemberStyleImageDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.modules.partymember.entity.IcPartymemberStyleImageEntity" id="icPartymemberStyleImageMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="styleId" column="STYLE_ID"/> |
||||
|
<result property="imageUrl" column="IMAGE_URL"/> |
||||
|
<result property="sort" column="SORT"/> |
||||
|
<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> |
Loading…
Reference in new issue