forked from rongchao/epmet-cloud-rizhao
41 changed files with 1654 additions and 113 deletions
@ -1,29 +0,0 @@ |
|||||
package com.epmet.dto.org; |
|
||||
|
|
||||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|
||||
import lombok.Data; |
|
||||
|
|
||||
import javax.validation.constraints.NotBlank; |
|
||||
import java.io.Serializable; |
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* @dscription 插叙客户网格基础信息--接口入参 |
|
||||
* @author sun |
|
||||
*/ |
|
||||
@Data |
|
||||
public class AgencyBaseInfoFormDTO implements Serializable { |
|
||||
|
|
||||
private static final long serialVersionUID = -3634745091993094743L; |
|
||||
/** |
|
||||
* 客户Id |
|
||||
*/ |
|
||||
@NotBlank(message = "事件标识不能为空", groups = {Agency.class}) |
|
||||
private String customerId = ""; |
|
||||
/** |
|
||||
* 组织Id |
|
||||
*/ |
|
||||
private List<String> agencyIdList; |
|
||||
public interface Agency extends CustomerClientShowGroup {} |
|
||||
|
|
||||
} |
|
||||
@ -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.dto.org.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridBaseInfoDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 工作人员Id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 网格员姓名 |
||||
|
*/ |
||||
|
private String GRID_LEVEL; |
||||
|
|
||||
|
/** |
||||
|
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; |
||||
|
*/ |
||||
|
private String GRID_TYPE; |
||||
|
|
||||
|
/** |
||||
|
* 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] |
||||
|
*/ |
||||
|
private String POPULATION_SIZE; |
||||
|
|
||||
|
/** |
||||
|
* 是否成立网格党支部或网格党小组[Y:是、N:否] |
||||
|
*/ |
||||
|
private String IS_PARTY_BRANCH; |
||||
|
|
||||
|
/** |
||||
|
* 网格党组织类型[01:网格党支部; 02:网格党小组] |
||||
|
*/ |
||||
|
private String PARTY_BRANCH_TYPE; |
||||
|
|
||||
|
/** |
||||
|
* 中心点(质心)经度 |
||||
|
*/ |
||||
|
private String LNG; |
||||
|
|
||||
|
/** |
||||
|
* 中心点(质心)纬度 |
||||
|
*/ |
||||
|
private String LAT; |
||||
|
|
||||
|
/** |
||||
|
* 网格颜色 |
||||
|
*/ |
||||
|
private Date GRID_COLOR; |
||||
|
|
||||
|
/** |
||||
|
* 空间范围 |
||||
|
*/ |
||||
|
private String SHAPE; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,152 @@ |
|||||
|
/** |
||||
|
* 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.dto.user.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GridUserInfoDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 工作人员Id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 网格员姓名 |
||||
|
*/ |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; |
||||
|
*/ |
||||
|
private String cardNum; |
||||
|
|
||||
|
/** |
||||
|
* 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员] |
||||
|
*/ |
||||
|
private String userType; |
||||
|
|
||||
|
/** |
||||
|
* 手机号码 |
||||
|
*/ |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 性别[1:男性; 2:女性; 9:未说明的性别] |
||||
|
*/ |
||||
|
private String sex; |
||||
|
|
||||
|
/** |
||||
|
* 民族[字典表主键] |
||||
|
*/ |
||||
|
private String nation; |
||||
|
|
||||
|
/** |
||||
|
* 政治面貌[字典表主键] |
||||
|
*/ |
||||
|
private String paerty; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期[YYYY-MM-DD] |
||||
|
*/ |
||||
|
private Date birthday; |
||||
|
|
||||
|
/** |
||||
|
* 学历[字典表主键] |
||||
|
*/ |
||||
|
private String education; |
||||
|
|
||||
|
/** |
||||
|
* 入职时间 |
||||
|
*/ |
||||
|
private Date entryDate; |
||||
|
|
||||
|
/** |
||||
|
* 是否离职 |
||||
|
*/ |
||||
|
private String isLeave; |
||||
|
|
||||
|
/** |
||||
|
* 离职时间 |
||||
|
*/ |
||||
|
private Date leaveDate; |
||||
|
|
||||
|
/** |
||||
|
* 网格员年收入 |
||||
|
*/ |
||||
|
private String income; |
||||
|
|
||||
|
/** |
||||
|
* 是否社区(村)两委委员[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isCommittee; |
||||
|
|
||||
|
/** |
||||
|
* 是否社区工作者[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isCommunityWorkers; |
||||
|
|
||||
|
/** |
||||
|
* 是否社会工作者[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isSocialWorker; |
||||
|
|
||||
|
/** |
||||
|
* 是否村(居)民小组长[Y:是、N:否 |
||||
|
*/ |
||||
|
private String isVillageLeader; |
||||
|
|
||||
|
/** |
||||
|
* 是否警务助理[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isPoliceAssistant; |
||||
|
|
||||
|
/** |
||||
|
* 是否人民调解员[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isMediator; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,136 @@ |
|||||
|
/** |
||||
|
* 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.opendata.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BaseGridInfoDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织/网格Id |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 网格层级[07:网格] |
||||
|
*/ |
||||
|
private String gridLevel; |
||||
|
|
||||
|
/** |
||||
|
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; |
||||
|
*/ |
||||
|
private String gridType; |
||||
|
|
||||
|
/** |
||||
|
* 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] |
||||
|
*/ |
||||
|
private String populationSize; |
||||
|
|
||||
|
/** |
||||
|
* 是否成立网格党支部或网格党小组[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isPartyBranch; |
||||
|
|
||||
|
/** |
||||
|
* 网格党组织类型[01:网格党支部; 02:网格党小组] |
||||
|
*/ |
||||
|
private String partyBranchType; |
||||
|
|
||||
|
/** |
||||
|
* 中心点(质心)经度 |
||||
|
*/ |
||||
|
private String lng; |
||||
|
|
||||
|
/** |
||||
|
* 中心点(质心)纬度 |
||||
|
*/ |
||||
|
private String lat; |
||||
|
|
||||
|
/** |
||||
|
* 网格颜色 |
||||
|
*/ |
||||
|
private String gridColor; |
||||
|
|
||||
|
/** |
||||
|
* 空间范围 |
||||
|
*/ |
||||
|
private String shape; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Long delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,191 @@ |
|||||
|
/** |
||||
|
* 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.opendata.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class BaseGridUserDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 人员Id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 网格员姓名 |
||||
|
*/ |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; |
||||
|
*/ |
||||
|
private String cardNum; |
||||
|
|
||||
|
/** |
||||
|
* 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员] |
||||
|
*/ |
||||
|
private String userType; |
||||
|
|
||||
|
/** |
||||
|
* 手机号码 |
||||
|
*/ |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 性别[1:男性; 2:女性; 9:未说明的性别] |
||||
|
*/ |
||||
|
private String sex; |
||||
|
|
||||
|
/** |
||||
|
* 民族[字典表主键] |
||||
|
*/ |
||||
|
private String nation; |
||||
|
|
||||
|
/** |
||||
|
* 政治面貌[字典表主键] |
||||
|
*/ |
||||
|
private String paerty; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期[YYYY-MM-DD] |
||||
|
*/ |
||||
|
private Date birthday; |
||||
|
|
||||
|
/** |
||||
|
* 学历[字典表主键] |
||||
|
*/ |
||||
|
private String education; |
||||
|
|
||||
|
/** |
||||
|
* 入职时间 |
||||
|
*/ |
||||
|
private Date entryDate; |
||||
|
|
||||
|
/** |
||||
|
* 是否离职 |
||||
|
*/ |
||||
|
private String isLeave; |
||||
|
|
||||
|
/** |
||||
|
* 离职时间 |
||||
|
*/ |
||||
|
private Date leaveDate; |
||||
|
|
||||
|
/** |
||||
|
* 网格员年收入 |
||||
|
*/ |
||||
|
private String income; |
||||
|
|
||||
|
/** |
||||
|
* 是否社区(村)两委委员[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isCommittee; |
||||
|
|
||||
|
/** |
||||
|
* 是否社区工作者[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isCommunityWorkers; |
||||
|
|
||||
|
/** |
||||
|
* 是否社会工作者[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isSocialWorker; |
||||
|
|
||||
|
/** |
||||
|
* 是否村(居)民小组长[Y:是、N:否 |
||||
|
*/ |
||||
|
private String isVillageLeader; |
||||
|
|
||||
|
/** |
||||
|
* 是否警务助理[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isPoliceAssistant; |
||||
|
|
||||
|
/** |
||||
|
* 是否人民调解员[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isMediator; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0.未删除 1.已删除 |
||||
|
*/ |
||||
|
private Long delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,67 @@ |
|||||
|
/** |
||||
|
* 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.opendata.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; |
||||
|
import com.epmet.opendata.service.BaseGridInfoService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("basegridinfo") |
||||
|
public class BaseGridInfoController { |
||||
|
|
||||
|
@Autowired |
||||
|
private BaseGridInfoService baseGridInfoService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 组织基础信息中介库同步 |
||||
|
**/ |
||||
|
@PostMapping("agencybaseinfo") |
||||
|
public Result getAgencyBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); |
||||
|
baseGridInfoService.getAgencyBaseInfo(formDTO); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 网格基础信息中介库同步 |
||||
|
**/ |
||||
|
@PostMapping("gridbaseinfo") |
||||
|
public Result getGridBaseInfo(@RequestBody(required = false) GridBaseInfoFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, GridBaseInfoFormDTO.Grid.class); |
||||
|
baseGridInfoService.getGridBaseInfo(formDTO); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,59 @@ |
|||||
|
/** |
||||
|
* 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.opendata.controller; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
||||
|
import com.epmet.dto.user.result.GridUserInfoDTO; |
||||
|
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; |
||||
|
import com.epmet.opendata.service.BaseGridUserService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("basegriduser") |
||||
|
public class BaseGridUserController { |
||||
|
|
||||
|
@Autowired |
||||
|
private BaseGridUserService baseGridUserService; |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 网格员信息中间库同步 |
||||
|
**/ |
||||
|
@PostMapping("staffbaseinfo") |
||||
|
public Result getStaffBaseInfo(@RequestBody(required = false) StaffBaseInfoFormDTO formDTO) { |
||||
|
ValidatorUtils.validateEntity(formDTO, StaffBaseInfoFormDTO.Staff.class); |
||||
|
baseGridUserService.getStaffBaseInfo(formDTO); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
/** |
||||
|
* 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.opendata.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.opendata.entity.BaseGridInfoEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 网格基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface BaseGridInfoDao extends BaseDao<BaseGridInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 网格基础信息批量更新部分字段 |
||||
|
**/ |
||||
|
void updateBatch(@Param("list") List<BaseGridInfoEntity> entityList); |
||||
|
} |
||||
@ -0,0 +1,41 @@ |
|||||
|
/** |
||||
|
* 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.opendata.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.opendata.entity.BaseGridUserEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface BaseGridUserDao extends BaseDao<BaseGridUserEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 网格员基础信息批量更新部分字段 |
||||
|
**/ |
||||
|
void updateBatch(@Param("list") List<BaseGridUserEntity> entityList); |
||||
|
} |
||||
@ -0,0 +1,106 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.opendata.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-15 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("base_grid_info") |
||||
|
public class BaseGridInfoEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 组织/网格Id |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 网格层级[07:网格] |
||||
|
*/ |
||||
|
private String gridLevel; |
||||
|
|
||||
|
/** |
||||
|
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; |
||||
|
*/ |
||||
|
private String gridType; |
||||
|
|
||||
|
/** |
||||
|
* 网格内人口规模[01:500人以下(含500人); 02:500-1000人(含1000人); 03:1000-1500人(含1500人); 04:1500人以上] |
||||
|
*/ |
||||
|
private String populationSize; |
||||
|
|
||||
|
/** |
||||
|
* 是否成立网格党支部或网格党小组[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isPartyBranch; |
||||
|
|
||||
|
/** |
||||
|
* 网格党组织类型[01:网格党支部; 02:网格党小组] |
||||
|
*/ |
||||
|
private String partyBranchType; |
||||
|
|
||||
|
/** |
||||
|
* 中心点(质心)经度 |
||||
|
*/ |
||||
|
private String lng; |
||||
|
|
||||
|
/** |
||||
|
* 中心点(质心)纬度 |
||||
|
*/ |
||||
|
private String lat; |
||||
|
|
||||
|
/** |
||||
|
* 网格颜色 |
||||
|
*/ |
||||
|
private String gridColor; |
||||
|
|
||||
|
/** |
||||
|
* 空间范围 |
||||
|
*/ |
||||
|
private String shape; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,161 @@ |
|||||
|
/** |
||||
|
* 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.opendata.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-15 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("base_grid_user") |
||||
|
public class BaseGridUserEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 网格Id |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 人员Id |
||||
|
*/ |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* 网格编码 |
||||
|
*/ |
||||
|
private String code; |
||||
|
|
||||
|
/** |
||||
|
* 网格名称 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 网格员姓名 |
||||
|
*/ |
||||
|
private String nickName; |
||||
|
|
||||
|
/** |
||||
|
* 专属网格类型[01:党政机关; 02:医院; 03:学校; 04:企业; 05:园区; 06:商圈; 07:市场; 08:景区; |
||||
|
*/ |
||||
|
private String cardNum; |
||||
|
|
||||
|
/** |
||||
|
* 网格员类型[01:专职网格员; 02:兼职网格员; 03:网格长; 04:综治机构人员; 05:职能部门人员] |
||||
|
*/ |
||||
|
private String userType; |
||||
|
|
||||
|
/** |
||||
|
* 手机号码 |
||||
|
*/ |
||||
|
private String phonenumber; |
||||
|
|
||||
|
/** |
||||
|
* 性别[1:男性; 2:女性; 9:未说明的性别] |
||||
|
*/ |
||||
|
private String sex; |
||||
|
|
||||
|
/** |
||||
|
* 民族[字典表主键] |
||||
|
*/ |
||||
|
private String nation; |
||||
|
|
||||
|
/** |
||||
|
* 政治面貌[字典表主键] |
||||
|
*/ |
||||
|
private String paerty; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期[YYYY-MM-DD] |
||||
|
*/ |
||||
|
private Date birthday; |
||||
|
|
||||
|
/** |
||||
|
* 学历[字典表主键] |
||||
|
*/ |
||||
|
private String education; |
||||
|
|
||||
|
/** |
||||
|
* 入职时间 |
||||
|
*/ |
||||
|
private Date entryDate; |
||||
|
|
||||
|
/** |
||||
|
* 是否离职 |
||||
|
*/ |
||||
|
private String isLeave; |
||||
|
|
||||
|
/** |
||||
|
* 离职时间 |
||||
|
*/ |
||||
|
private Date leaveDate; |
||||
|
|
||||
|
/** |
||||
|
* 网格员年收入 |
||||
|
*/ |
||||
|
private String income; |
||||
|
|
||||
|
/** |
||||
|
* 是否社区(村)两委委员[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isCommittee; |
||||
|
|
||||
|
/** |
||||
|
* 是否社区工作者[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isCommunityWorkers; |
||||
|
|
||||
|
/** |
||||
|
* 是否社会工作者[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isSocialWorker; |
||||
|
|
||||
|
/** |
||||
|
* 是否村(居)民小组长[Y:是、N:否 |
||||
|
*/ |
||||
|
private String isVillageLeader; |
||||
|
|
||||
|
/** |
||||
|
* 是否警务助理[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isPoliceAssistant; |
||||
|
|
||||
|
/** |
||||
|
* 是否人民调解员[Y:是、N:否] |
||||
|
*/ |
||||
|
private String isMediator; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
/** |
||||
|
* 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.opendata.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; |
||||
|
import com.epmet.opendata.entity.BaseGridInfoEntity; |
||||
|
|
||||
|
/** |
||||
|
* 网格基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
public interface BaseGridInfoService extends BaseService<BaseGridInfoEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 组织基础信息中介库同步 |
||||
|
**/ |
||||
|
void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 网格基础信息中介库同步 |
||||
|
**/ |
||||
|
void getGridBaseInfo(GridBaseInfoFormDTO formDTO); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,38 @@ |
|||||
|
/** |
||||
|
* 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.opendata.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; |
||||
|
import com.epmet.opendata.entity.BaseGridUserEntity; |
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
public interface BaseGridUserService extends BaseService<BaseGridUserEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 网格员信息中间库同步 |
||||
|
**/ |
||||
|
void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,120 @@ |
|||||
|
/** |
||||
|
* 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.opendata.service.impl; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.org.result.CustomerAgencyDTO; |
||||
|
import com.epmet.dto.org.result.CustomerGridDTO; |
||||
|
import com.epmet.feign.DataStatisticalOpenFeignClient; |
||||
|
import com.epmet.opendata.dao.BaseGridInfoDao; |
||||
|
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; |
||||
|
import com.epmet.opendata.entity.BaseGridInfoEntity; |
||||
|
import com.epmet.opendata.service.BaseGridInfoService; |
||||
|
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.List; |
||||
|
|
||||
|
/** |
||||
|
* 网格基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, BaseGridInfoEntity> implements BaseGridInfoService { |
||||
|
@Autowired |
||||
|
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 组织基础信息中介库同步 |
||||
|
**/ |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void getAgencyBaseInfo(GridBaseInfoFormDTO formDTO) { |
||||
|
//1.查询网格基础信息
|
||||
|
Result<List<CustomerAgencyDTO>> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO); |
||||
|
if (!result.success()) { |
||||
|
throw new RenException(result.getInternalMsg()); |
||||
|
} |
||||
|
//2.中间库新增/修改数据
|
||||
|
List<BaseGridInfoEntity> entityList = new ArrayList<>(); |
||||
|
result.getData().forEach(ag->{ |
||||
|
BaseGridInfoEntity entity = new BaseGridInfoEntity(); |
||||
|
entity.setCustomerId(ag.getCustomerId()); |
||||
|
entity.setOrgId(ag.getId()); |
||||
|
entity.setCode(""); |
||||
|
entity.setGridName(ag.getOrganizationName()); |
||||
|
String level = "06"; |
||||
|
if("province".equals(ag.getLevel())){ level = "01"; } |
||||
|
else if("city".equals(ag.getLevel())){ level = "02"; } |
||||
|
else if("district".equals(ag.getLevel())){ level = "03"; } |
||||
|
else if("street".equals(ag.getLevel())){ level = "04"; } |
||||
|
entity.setGridLevel(level); |
||||
|
entity.setGridType("01"); |
||||
|
entityList.add(entity); |
||||
|
}); |
||||
|
if("add".equals(formDTO.getType())){ |
||||
|
insertBatch(entityList); |
||||
|
}else { |
||||
|
baseDao.updateBatch(entityList); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 网格基础信息中介库同步 |
||||
|
**/ |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void getGridBaseInfo(GridBaseInfoFormDTO formDTO) { |
||||
|
//1.查询网格基础信息
|
||||
|
Result<List<CustomerGridDTO>> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO); |
||||
|
if (!result.success()) { |
||||
|
throw new RenException(result.getInternalMsg()); |
||||
|
} |
||||
|
//2.中间库新增/修改数据
|
||||
|
List<BaseGridInfoEntity> entityList = new ArrayList<>(); |
||||
|
result.getData().forEach(ag->{ |
||||
|
BaseGridInfoEntity entity = new BaseGridInfoEntity(); |
||||
|
entity.setCustomerId(ag.getCustomerId()); |
||||
|
entity.setOrgId(ag.getId()); |
||||
|
entity.setCode(""); |
||||
|
entity.setGridName(ag.getGridName()); |
||||
|
entity.setGridLevel("07"); |
||||
|
entity.setGridType("01"); |
||||
|
entity.setDelFlag(ag.getDelFlag().toString()); |
||||
|
entity.setUpdatedBy(ag.getUpdatedBy()); |
||||
|
entity.setUpdatedTime(ag.getUpdatedTime()); |
||||
|
entityList.add(entity); |
||||
|
}); |
||||
|
if("add".equals(formDTO.getType())){ |
||||
|
insertBatch(entityList); |
||||
|
}else { |
||||
|
baseDao.updateBatch(entityList); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,73 @@ |
|||||
|
/** |
||||
|
* 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.opendata.service.impl; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.org.result.CustomerAgencyDTO; |
||||
|
import com.epmet.dto.user.result.CustomerStaffDTO; |
||||
|
import com.epmet.dto.user.result.GridUserInfoDTO; |
||||
|
import com.epmet.feign.DataStatisticalOpenFeignClient; |
||||
|
import com.epmet.opendata.dao.BaseGridUserDao; |
||||
|
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; |
||||
|
import com.epmet.opendata.entity.BaseGridInfoEntity; |
||||
|
import com.epmet.opendata.entity.BaseGridUserEntity; |
||||
|
import com.epmet.opendata.service.BaseGridUserService; |
||||
|
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.List; |
||||
|
|
||||
|
/** |
||||
|
* 网格员基础信息表 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-10-15 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class BaseGridUserServiceImpl extends BaseServiceImpl<BaseGridUserDao, BaseGridUserEntity> implements BaseGridUserService { |
||||
|
@Autowired |
||||
|
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 网格员信息中间库同步 |
||||
|
**/ |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { |
||||
|
//1.查询网格基础信息
|
||||
|
Result<List<GridUserInfoDTO>> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO); |
||||
|
if (!result.success()) { |
||||
|
throw new RenException(result.getInternalMsg()); |
||||
|
} |
||||
|
//2.中间库新增/修改数据
|
||||
|
List<BaseGridUserEntity> entityList = ConvertUtils.sourceToTarget(result.getData(), BaseGridUserEntity.class); |
||||
|
if("add".equals(formDTO.getType())){ |
||||
|
insertBatch(entityList); |
||||
|
}else { |
||||
|
baseDao.updateBatch(entityList); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
<?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.opendata.dao.BaseGridInfoDao"> |
||||
|
|
||||
|
<update id="updateBatch" > |
||||
|
UPDATE base_grid_info |
||||
|
<trim prefix="set" suffixOverrides=","> |
||||
|
|
||||
|
<trim prefix="grid_name =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.gridName'> |
||||
|
when org_id = #{item.orgId} then #{item.gridName} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
<trim prefix="del_flag =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.delFlag'> |
||||
|
when org_id = #{item.orgId} then #{item.delFlag} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
<trim prefix="updated_by =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.updatedBy'> |
||||
|
when org_id = #{item.orgId} then #{item.updatedBy} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
<trim prefix="updated_time =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.updatedTime'> |
||||
|
when org_id = #{item.orgId} then #{item.updatedTime} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
</trim> |
||||
|
WHERE |
||||
|
1=1 |
||||
|
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")"> |
||||
|
org_id = #{item.orgId} |
||||
|
</foreach> |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,58 @@ |
|||||
|
<?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.opendata.dao.BaseGridUserDao"> |
||||
|
|
||||
|
<update id="updateBatch"> |
||||
|
UPDATE base_grid_user |
||||
|
<trim prefix="set" suffixOverrides=","> |
||||
|
|
||||
|
<trim prefix="grid_name =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.gridName'> |
||||
|
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.gridName} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
<trim prefix="nick_name =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.nickName'> |
||||
|
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.nickName} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
<trim prefix="del_flag =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.delFlag'> |
||||
|
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.delFlag} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
<trim prefix="updated_by =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.updatedBy'> |
||||
|
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedBy} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
<trim prefix="updated_time =(case" suffix="end),"> |
||||
|
<foreach collection="list" item="item"> |
||||
|
<if test='null != item.updatedTime'> |
||||
|
when (grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) then #{item.updatedTime} |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
|
||||
|
</trim> |
||||
|
WHERE |
||||
|
1=1 |
||||
|
<foreach collection="list" item="item" open="AND( " separator=" OR " index="index" close=")"> |
||||
|
(grid_id = #{item.gridId} AND staff_id = #{item.staffId} ) |
||||
|
</foreach> |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
||||
Loading…
Reference in new issue