diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/ScreenReportEnterpriseDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/ScreenReportEnterpriseDTO.java new file mode 100644 index 0000000000..bc6e1826d6 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/ScreenReportEnterpriseDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.partymember.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用于上报蔬菜的企业 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2024-03-22 + */ +@Data +public class ScreenReportEnterpriseDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 密码 + */ + private String password; + + /** + * 企业类别: + */ + private String placeCategory; + + /** + * 企业名称 + */ + private String placeOrgName; + + /** + * 企业地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenReportEnterpriseController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenReportEnterpriseController.java new file mode 100644 index 0000000000..450545df14 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/ScreenReportEnterpriseController.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.controller; + + +import com.epmet.commons.tools.page.PageData; +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.service.ScreenReportEnterpriseService; +import com.epmet.resi.partymember.dto.ScreenReportEnterpriseDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 用于上报蔬菜的企业 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2024-03-22 + */ +@RestController +@RequestMapping("screenreportenterprise") +public class ScreenReportEnterpriseController { + + @Autowired + private ScreenReportEnterpriseService screenReportEnterpriseService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = screenReportEnterpriseService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ScreenReportEnterpriseDTO data = screenReportEnterpriseService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ScreenReportEnterpriseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + screenReportEnterpriseService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ScreenReportEnterpriseDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + screenReportEnterpriseService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + screenReportEnterpriseService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/ScreenReportEnterpriseDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/ScreenReportEnterpriseDao.java new file mode 100644 index 0000000000..70302967b4 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/ScreenReportEnterpriseDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.partymember.entity.ScreenReportEnterpriseEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用于上报蔬菜的企业 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2024-03-22 + */ +@Mapper +public interface ScreenReportEnterpriseDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/ScreenReportEnterpriseEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/ScreenReportEnterpriseEntity.java new file mode 100644 index 0000000000..138a607f7d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/entity/ScreenReportEnterpriseEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 elink elink@elink-cn.com + * @since v1.0.0 2024-03-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_report_enterprise") +public class ScreenReportEnterpriseEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 密码 + */ + private String password; + + /** + * 企业类别: + */ + private String placeCategory; + + /** + * 企业名称 + */ + private String placeOrgName; + + /** + * 企业地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 场所负责人 + */ + private String personInCharge; + + /** + * 负责人电话 + */ + private String mobile; + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenReportEnterpriseService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenReportEnterpriseService.java new file mode 100644 index 0000000000..fe42f56453 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/ScreenReportEnterpriseService.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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.ScreenReportEnterpriseEntity; +import com.epmet.resi.partymember.dto.ScreenReportEnterpriseDTO; + +import java.util.List; +import java.util.Map; + +/** + * 用于上报蔬菜的企业 + * + * @author elink elink@elink-cn.com + * @since v1.0.0 2024-03-22 + */ +public interface ScreenReportEnterpriseService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2024-03-22 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2024-03-22 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenReportEnterpriseDTO + * @author generator + * @date 2024-03-22 + */ + ScreenReportEnterpriseDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2024-03-22 + */ + void save(ScreenReportEnterpriseDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2024-03-22 + */ + void update(ScreenReportEnterpriseDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2024-03-22 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenReportEnterpriseServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenReportEnterpriseServiceImpl.java new file mode 100644 index 0000000000..74f7cdd373 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/ScreenReportEnterpriseServiceImpl.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.partymember.service.impl; + +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.security.password.PasswordUtils; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.partymember.dao.ScreenReportEnterpriseDao; +import com.epmet.modules.partymember.entity.ScreenReportEnterpriseEntity; +import com.epmet.modules.partymember.service.ScreenReportEnterpriseService; +import com.epmet.resi.partymember.dto.ScreenReportEnterpriseDTO; +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 elink elink@elink-cn.com + * @since v1.0.0 2024-03-22 + */ +@Service +public class ScreenReportEnterpriseServiceImpl extends BaseServiceImpl implements ScreenReportEnterpriseService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenReportEnterpriseDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenReportEnterpriseDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenReportEnterpriseDTO get(String id) { + ScreenReportEnterpriseEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenReportEnterpriseDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenReportEnterpriseDTO dto) { + ScreenReportEnterpriseEntity entity = ConvertUtils.sourceToTarget(dto, ScreenReportEnterpriseEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenReportEnterpriseDTO dto) { + ScreenReportEnterpriseEntity entity = ConvertUtils.sourceToTarget(dto, ScreenReportEnterpriseEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/ScreenReportEnterpriseDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/ScreenReportEnterpriseDao.xml new file mode 100644 index 0000000000..f1a4960c5d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/ScreenReportEnterpriseDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file