diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java new file mode 100644 index 0000000000..8cb632f6bc --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/GridUserWorkDTO.java @@ -0,0 +1,148 @@ +/** + * 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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格员例行工作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +@Data +public class GridUserWorkDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 组织名称 + */ + private String orgId; + + /** + * 组织名称 xx社区-xx网格 + */ + private String orgName; + + /** + * PIDS + */ + private String pids; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 例行工作类型 +01:重点巡查 +0101:出租房巡查 +0102:新增流动人口 +0103:重点场所巡查 +0104:宗教活动 +0199:其他 +02:特殊人群 +0201:刑满释放人员 +0202:社区矫正 +0203:吸毒人员 +0204:信访人员 + */ + private String workType; + + /** + * 例行工作类型名字 + */ + private String workTypeName; + + /** + * 发生日期 格式为“YYYY-MM-DD” + */ + private Date happenTime; + + /** + * 基础信息主键 +出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填 + */ + private String baseInfoId; + + /** + * 有无变动(异常)Y:是、N:否 + */ + private String workResult; + + /** + * 备注说明 + */ + private String workContent; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private String revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java new file mode 100644 index 0000000000..33eb35bb46 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GridUserWorkController.java @@ -0,0 +1,22 @@ +package com.epmet.controller; + +import com.epmet.service.GridUserWorkService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 网格员例行工作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +@RestController +@RequestMapping("griduserwork") +public class GridUserWorkController { + + @Autowired + private GridUserWorkService gridUserWorkService; + + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.java new file mode 100644 index 0000000000..468a6ab5b5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GridUserWorkDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GridUserWorkEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格员例行工作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +@Mapper +public interface GridUserWorkDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java new file mode 100644 index 0000000000..81b54fbf02 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/GridUserWorkEntity.java @@ -0,0 +1,118 @@ +/** + * 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.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 generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("grid_user_work") +public class GridUserWorkEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 组织名称 + */ + private String orgId; + + /** + * 组织名称 xx社区-xx网格 + */ + private String orgName; + + /** + * PIDS + */ + private String pids; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 例行工作类型 +01:重点巡查 +0101:出租房巡查 +0102:新增流动人口 +0103:重点场所巡查 +0104:宗教活动 +0199:其他 +02:特殊人群 +0201:刑满释放人员 +0202:社区矫正 +0203:吸毒人员 +0204:信访人员 + */ + private String workType; + + /** + * 例行工作类型名字 + */ + private String workTypeName; + + /** + * 发生日期 格式为“YYYY-MM-DD” + */ + private Date happenTime; + + /** + * 基础信息主键 +出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填 + */ + private String baseInfoId; + + /** + * 有无变动(异常)Y:是、N:否 + */ + private String workResult; + + /** + * 备注说明 + */ + private String workContent; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java new file mode 100644 index 0000000000..c5dc23b976 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GridUserWorkService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GridUserWorkDTO; +import com.epmet.entity.GridUserWorkEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格员例行工作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +public interface GridUserWorkService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-10-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-10-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GridUserWorkDTO + * @author generator + * @date 2021-10-19 + */ + GridUserWorkDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-19 + */ + void save(GridUserWorkDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-10-19 + */ + void update(GridUserWorkDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-10-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java new file mode 100644 index 0000000000..bcaf16f379 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridUserWorkServiceImpl.java @@ -0,0 +1,82 @@ +package com.epmet.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.GridUserWorkDao; +import com.epmet.dto.GridUserWorkDTO; +import com.epmet.entity.GridUserWorkEntity; +import com.epmet.service.GridUserWorkService; +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; + +/** + * 网格员例行工作 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-10-19 + */ +@Service +public class GridUserWorkServiceImpl extends BaseServiceImpl implements GridUserWorkService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GridUserWorkDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GridUserWorkDTO.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 GridUserWorkDTO get(String id) { + GridUserWorkEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GridUserWorkDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GridUserWorkDTO dto) { + GridUserWorkEntity entity = ConvertUtils.sourceToTarget(dto, GridUserWorkEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GridUserWorkDTO dto) { + GridUserWorkEntity entity = ConvertUtils.sourceToTarget(dto, GridUserWorkEntity.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-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml new file mode 100644 index 0000000000..70467112b6 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GridUserWorkDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file