Browse Source

完善

master
lichao 1 year ago
parent
commit
5fec5e44a6
  1. 4
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/IcPartyPlaceDTO.java
  2. 92
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyInventoryDTO.java
  3. 63
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyInventoryListResultDTO.java
  4. 94
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyInventoryController.java
  5. 21
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/YiFengScreenController.java
  6. 33
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyInventoryDao.java
  7. 62
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyInventoryEntity.java
  8. 71
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyInventoryExcel.java
  9. 47
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyInventoryRedis.java
  10. 99
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyInventoryService.java
  11. 129
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyInventoryServiceImpl.java
  12. 22
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyInventoryDao.xml

4
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/IcPartyPlaceDTO.java

@ -76,5 +76,9 @@ public class IcPartyPlaceDTO implements Serializable {
* 更新时间 * 更新时间
*/ */
private Date updatedTime; private Date updatedTime;
/**
* 类型 1公司 2阵地
*/
private Integer type;
} }

92
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/IcPartyInventoryDTO.java

@ -0,0 +1,92 @@
/**
* 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 qu qu@elink-cn.com
* @since v1.0.0 2024-03-14
*/
@Data
public class IcPartyInventoryDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
private String parentId;
/**
* 客户ID
*/
private String customerId;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 类型 1:目录 2:提纲
*/
private Integer type;
/**
* 0未删除1已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

63
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/result/IcPartyInventoryListResultDTO.java

@ -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.resi.partymember.dto.partymember.result;
import com.epmet.resi.partymember.dto.partymember.IcPartyInventoryDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 移列清单
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2024-03-14
*/
@Data
public class IcPartyInventoryListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String id;
private String parentId;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 类型 1:目录 2:提纲
*/
private Integer type;
private List<IcPartyInventoryDTO> children;
}

94
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyInventoryController.java

@ -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.IcPartyInventoryExcel;
import com.epmet.modules.partymember.service.IcPartyInventoryService;
import com.epmet.resi.partymember.dto.partymember.IcPartyInventoryDTO;
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 2024-03-14
*/
@RestController
@RequestMapping("icpartyinventory")
public class IcPartyInventoryController {
@Autowired
private IcPartyInventoryService icPartyInventoryService;
@GetMapping("page")
public Result<PageData<IcPartyInventoryDTO>> page(@RequestParam Map<String, Object> params){
PageData<IcPartyInventoryDTO> page = icPartyInventoryService.page(params);
return new Result<PageData<IcPartyInventoryDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IcPartyInventoryDTO> get(@PathVariable("id") String id){
IcPartyInventoryDTO data = icPartyInventoryService.get(id);
return new Result<IcPartyInventoryDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IcPartyInventoryDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icPartyInventoryService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IcPartyInventoryDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icPartyInventoryService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icPartyInventoryService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<IcPartyInventoryDTO> list = icPartyInventoryService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, IcPartyInventoryExcel.class);
}
}

21
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/YiFengScreenController.java

@ -13,10 +13,7 @@ import com.epmet.modules.partyOrg.service.IcPartyOrgCensusService;
import com.epmet.modules.partyOrg.service.IcPartyOrgLeaderService; import com.epmet.modules.partyOrg.service.IcPartyOrgLeaderService;
import com.epmet.modules.partyOrg.service.IcPartyWishService; import com.epmet.modules.partyOrg.service.IcPartyWishService;
import com.epmet.modules.partyOrg.service.YiFengPartyOrgService; import com.epmet.modules.partyOrg.service.YiFengPartyOrgService;
import com.epmet.modules.partymember.service.IcParameterConfigService; import com.epmet.modules.partymember.service.*;
import com.epmet.modules.partymember.service.IcPartyPlaceService;
import com.epmet.modules.partymember.service.IcPartymemberStyleService;
import com.epmet.modules.partymember.service.YiFengScreenService;
import com.epmet.resi.partymember.dto.IcPartyPlaceDTO; import com.epmet.resi.partymember.dto.IcPartyPlaceDTO;
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO;
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO;
@ -27,6 +24,7 @@ import com.epmet.resi.partymember.dto.partyOrg.IcPartyWishDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO; import com.epmet.resi.partymember.dto.partyOrg.result.LingShanPartyOrgAndOtherObjQtyRstDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO; import com.epmet.resi.partymember.dto.partyOrg.result.LingShanScreenPartyObjectByTypeRstDTO;
import com.epmet.resi.partymember.dto.partymember.IcParameterConfigDTO; import com.epmet.resi.partymember.dto.partymember.IcParameterConfigDTO;
import com.epmet.resi.partymember.dto.partymember.IcPartyInventoryDTO;
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO;
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO;
import com.epmet.resi.partymember.dto.partymember.result.*; import com.epmet.resi.partymember.dto.partymember.result.*;
@ -65,7 +63,22 @@ public class YiFengScreenController {
private IcPartymemberStyleService icPartymemberStyleService; private IcPartymemberStyleService icPartymemberStyleService;
@Autowired @Autowired
private IcParameterConfigService icParameterConfigService; private IcParameterConfigService icParameterConfigService;
@Autowired
private IcPartyInventoryService icPartyInventoryService;
/**
* @Description: 移列清单
* @param :
* @Return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.resi.partymember.dto.partymember.result.IcPartyInventoryListResultDTO>>
* @Author: lichao
* @Date: 2024/3/14 13:38
*/
@GetMapping("selectInventoryList")
public Result<List<IcPartyInventoryListResultDTO>> selectInventoryList(){
List<IcPartyInventoryListResultDTO> result = icPartyInventoryService.selectInventoryList();
return new Result<List<IcPartyInventoryListResultDTO>>().ok(result);
}
/** /**
* @Description: 党员年龄统计 * @Description: 党员年龄统计
* @param : * @param :

33
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/IcPartyInventoryDao.java

@ -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.IcPartyInventoryEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 移列清单
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2024-03-14
*/
@Mapper
public interface IcPartyInventoryDao extends BaseDao<IcPartyInventoryEntity> {
}

62
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/IcPartyInventoryEntity.java

@ -0,0 +1,62 @@
/**
* 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;
import java.util.Date;
/**
* 移列清单
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2024-03-14
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_party_inventory")
public class IcPartyInventoryEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
private String parentId;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 类型
*/
private Integer type;
}

71
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/excel/IcPartyInventoryExcel.java

@ -0,0 +1,71 @@
/**
* 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 qu qu@elink-cn.com
* @since v1.0.0 2024-03-14
*/
@Data
public class IcPartyInventoryExcel {
@Excel(name = "ID")
private String id;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "标题")
private String title;
@Excel(name = "描述")
private String describe;
@Excel(name = "内容")
private String content;
@Excel(name = "类型")
private Integer type;
@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;
}

47
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/redis/IcPartyInventoryRedis.java

@ -0,0 +1,47 @@
/**
* 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.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 移列清单
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2024-03-14
*/
@Component
public class IcPartyInventoryRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

99
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyInventoryService.java

@ -0,0 +1,99 @@
/**
* 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.IcPartyInventoryEntity;
import com.epmet.resi.partymember.dto.partymember.IcPartyInventoryDTO;
import com.epmet.resi.partymember.dto.partymember.result.IcPartyInventoryListResultDTO;
import java.util.List;
import java.util.Map;
/**
* 移列清单
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2024-03-14
*/
public interface IcPartyInventoryService extends BaseService<IcPartyInventoryEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcPartyInventoryDTO>
* @author generator
* @date 2024-03-14
*/
PageData<IcPartyInventoryDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcPartyInventoryDTO>
* @author generator
* @date 2024-03-14
*/
List<IcPartyInventoryDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IcPartyInventoryDTO
* @author generator
* @date 2024-03-14
*/
IcPartyInventoryDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2024-03-14
*/
void save(IcPartyInventoryDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2024-03-14
*/
void update(IcPartyInventoryDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2024-03-14
*/
void delete(String[] ids);
List<IcPartyInventoryListResultDTO> selectInventoryList();
}

129
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyInventoryServiceImpl.java

@ -0,0 +1,129 @@
/**
* 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.IcPartyInventoryDao;
import com.epmet.modules.partymember.entity.IcPartyInventoryEntity;
import com.epmet.modules.partymember.redis.IcPartyInventoryRedis;
import com.epmet.modules.partymember.service.IcPartyInventoryService;
import com.epmet.resi.partymember.dto.partymember.IcPartyInventoryDTO;
import com.epmet.resi.partymember.dto.partymember.result.IcPartyInventoryListResultDTO;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 移列清单
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2024-03-14
*/
@Service
public class IcPartyInventoryServiceImpl extends BaseServiceImpl<IcPartyInventoryDao, IcPartyInventoryEntity> implements IcPartyInventoryService {
@Override
public PageData<IcPartyInventoryDTO> page(Map<String, Object> params) {
IPage<IcPartyInventoryEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcPartyInventoryDTO.class);
}
@Override
public List<IcPartyInventoryDTO> list(Map<String, Object> params) {
List<IcPartyInventoryEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcPartyInventoryDTO.class);
}
private QueryWrapper<IcPartyInventoryEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcPartyInventoryEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcPartyInventoryDTO get(String id) {
IcPartyInventoryEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IcPartyInventoryDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcPartyInventoryDTO dto) {
IcPartyInventoryEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyInventoryEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcPartyInventoryDTO dto) {
IcPartyInventoryEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyInventoryEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public List<IcPartyInventoryListResultDTO> selectInventoryList() {
List<IcPartyInventoryListResultDTO> resultDTOS = new ArrayList<>();
LambdaQueryWrapper<IcPartyInventoryEntity> queryWrapperP = new LambdaQueryWrapper<>();
queryWrapperP.eq(IcPartyInventoryEntity::getParentId,0);
List<IcPartyInventoryEntity> entityPList = baseDao.selectList(queryWrapperP);
if (entityPList.size() > 0){
resultDTOS = ConvertUtils.sourceToTarget(entityPList,IcPartyInventoryListResultDTO.class);
resultDTOS.forEach(result->{
LambdaQueryWrapper<IcPartyInventoryEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IcPartyInventoryEntity::getParentId,result.getId());
List<IcPartyInventoryEntity> entityList = baseDao.selectList(queryWrapper);
if (entityList.size() > 0){
result.setChildren(ConvertUtils.sourceToTarget(entityList, IcPartyInventoryDTO.class));
}
});
}
return resultDTOS;
}
}

22
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/IcPartyInventoryDao.xml

@ -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.IcPartyInventoryDao">
<resultMap type="com.epmet.modules.partymember.entity.IcPartyInventoryEntity" id="icPartyInventoryMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="title" column="TITLE"/>
<result property="describe" column="DESCRIBE"/>
<result property="content" column="CONTENT"/>
<result property="type" column="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>
Loading…
Cancel
Save