5 files modified
14 files added
| | |
| | | |
| | | private final IHouseholdService householdService; |
| | | |
| | | |
| | | /** |
| | | * 住户 详情 |
| | | */ |
| | |
| | | return R.data(householdService.userHandle()); |
| | | } |
| | | |
| | | /** |
| | | * 获取所有住户 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAllHouseHold") |
| | | public R getAllHouseHold(HouseholdVO household) { |
| | | return R.data(householdService.getAllHouseHold(household)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | List<HouseholdVO> selectHouseholdPage(IPage page,@Param("household") HouseholdVO household); |
| | | |
| | | /** |
| | | * 获取全部 |
| | | * @param household |
| | | * @return |
| | | */ |
| | | List<HouseholdVO> getAllHouseHold(@Param("household")HouseholdVO household); |
| | | |
| | | |
| | | /** |
| | | * 查询房屋集合信息 |
| | |
| | | * @return |
| | | */ |
| | | List<HouseholdEntity> getNotInsertUserHousehold(); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="getAllHouseHold" resultMap="householdPageAndLabelMap"> |
| | | SELECT |
| | | jh.id, |
| | | jh.house_code, |
| | | jh.NAME, |
| | | jh.phone_number, |
| | | jh.associated_user_id, |
| | | jh.role_type, |
| | | jh.associated_user_name, |
| | | jh.relationship, |
| | | jh.is_primary_contact, |
| | | jh.residential_status, |
| | | jh.birthday, |
| | | jh.id_card, |
| | | jh.hkmt_pass, |
| | | jh.passport, |
| | | ifnull( jh.gender, CASE WHEN substring( jh.id_card, 17, 1 )% 2 = 1 THEN 1 ELSE 0 END ) AS gender, |
| | | jh.ethnicity, |
| | | jh.education, |
| | | jh.hukou_registration, |
| | | jh.work_status, |
| | | employer, |
| | | jh.marital_status, |
| | | jh.card_number, |
| | | jh.other_contact, |
| | | jh.current_address, |
| | | jh.disability_cert, |
| | | jh.party_ember, |
| | | jh.create_user, |
| | | jh.create_time, |
| | | jh.update_user, |
| | | jh.update_time, |
| | | jh.confirm_flag, |
| | | jh.remark, |
| | | jhs.district_name aoiName, |
| | | concat( jhs.building, " ", unit, " ", room ) AS address, |
| | | jda.town_street_name AS townStreetName, |
| | | jda.nei_name AS neiName, |
| | | jg.grid_name |
| | | FROM |
| | | jczz_household jh |
| | | LEFT JOIN jczz_house jhs ON jh.house_code = jhs.house_code and jhs.is_deleted = 0 |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jh.house_code |
| | | LEFT JOIN jczz_grid_range jgr on jgr.house_code=jda.address_code |
| | | LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id |
| | | <where> |
| | | <if test="household.userId!=null"> |
| | | AND jg.id IN ( SELECT DISTINCT jgm.grid_id FROM jczz_gridman jgm WHERE jgm.user_id = #{household.userId} |
| | | ) |
| | | </if> |
| | | <if test="household.name!=null and household.name !=''"> |
| | | and jh.name like concat('%',#{household.name},'%') |
| | | </if> |
| | | <if test="household.houseCode!=null and household.houseCode !=''"> |
| | | and jh.house_code = #{household.houseCode} |
| | | </if> |
| | | <if test="household.phoneNumber!=null and household.phoneNumber !=''"> |
| | | and jh.phone_number like concat('%',#{household.phoneNumber},'%') |
| | | </if> |
| | | <if test="household.idCard!=null and household.idCard !=''"> |
| | | and jh.id_card like concat('%',#{household.idCard},'%') |
| | | </if> |
| | | <if test="household.aoiName!=null and household.aoiName !=''"> |
| | | and jhs.district_name like concat('%',#{household.aoiName},'%') |
| | | </if> |
| | | <if test="household.confirmFlag != null "> |
| | | and jh.confirm_flag = #{household.confirmFlag} |
| | | </if> |
| | | <if test="household.townStreetName!=null and household.townStreetName!=''"> |
| | | and jda.town_street_name like concat('%',#{household.townStreetName},'%') |
| | | </if> |
| | | <if test="household.neiName!=null and household.neiName!=''"> |
| | | and jda.nei_name like concat('%',#{household.neiName},'%') |
| | | </if> |
| | | <if test="household.housingRentalId != null "> |
| | | and jh.housing_rental_id = #{household.housingRentalId} |
| | | </if> |
| | | <if test="household.startTime != null and household.startTime != '' and household.endTime != null and household.endTime != '' "> |
| | | AND jh.create_time BETWEEN #{household.startTime} and #{household.endTime} |
| | | </if> |
| | | <if test="household.regionCode!=null and household.regionCode!=''"> |
| | | and jg.community_code like concat('%',#{household.regionCode},'%') |
| | | </if> |
| | | <if test="household.id!=null and household.id!=''"> |
| | | and jh.id = #{household.id} |
| | | </if> |
| | | and jh.is_deleted = 0 |
| | | order by jh.create_time desc |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <!--查询房屋集合信息--> |
| | | <select id="selectHouseNodeList" resultType="org.springblade.common.node.TreeStringNode" > |
| | | select jh.house_code as id, |
| | |
| | | * 住户 删除 |
| | | */ |
| | | boolean removeHousehold(String ids); |
| | | |
| | | List<HouseholdVO> getAllHouseHold(HouseholdVO household); |
| | | } |
| | |
| | | userHouseLabelService.remove(wrapper); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<HouseholdVO> getAllHouseHold(HouseholdVO household) { |
| | | return baseMapper.getAllHouseHold(household); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.service.IPartyOrganizationService; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("partyOrganization/partyOrganization") |
| | | @Api(value = "业委会表", tags = "业委会表接口") |
| | | public class PartyOrganizationController extends BladeController { |
| | | |
| | | private final IPartyOrganizationService partyOrganizationService; |
| | | |
| | | |
| | | /** |
| | | * 党组织 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入ownersCommittee") |
| | | public R<PartyOrganization> detail(PartyOrganizationVO partyOrganizationVO) { |
| | | PartyOrganization detail = partyOrganizationService.getOne(Condition.getQueryWrapper(partyOrganizationVO)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 党组织 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入ownersCommittee") |
| | | public R<IPage<PartyOrganizationVO>> page(PartyOrganizationVO PartyOrganizationVO, Query query) { |
| | | IPage<PartyOrganizationVO> pages = partyOrganizationService.getPage(Condition.getPage(query), PartyOrganizationVO); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 党组织 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入ownersCommittee") |
| | | public R save(@Valid @RequestBody PartyOrganization partyOrganization) { |
| | | return R.status(partyOrganizationService.save(partyOrganization)); |
| | | } |
| | | |
| | | /** |
| | | * 党组织 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入ownersCommittee") |
| | | public R update(@Valid @RequestBody PartyOrganization partyOrganization) { |
| | | return R.status(partyOrganizationService.updateById(partyOrganization)); |
| | | } |
| | | |
| | | /** |
| | | * 党组织 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入ownersCommittee") |
| | | public R submit(@Valid @RequestBody PartyOrganization partyOrganization) { |
| | | return R.status(partyOrganizationService.saveOrUpdate(partyOrganization)); |
| | | } |
| | | |
| | | /** |
| | | * 党组织 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(partyOrganizationService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganizationMember; |
| | | import org.springblade.modules.partyOrganization.service.IPartyOrganizationMemberService; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationMemberVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("partyOrganizationMember/partyOrganizationMember") |
| | | @Api(value = "党成员表", tags = "党成员表接口") |
| | | public class PartyOrganizationMemberController extends BladeController { |
| | | |
| | | private final IPartyOrganizationMemberService partyOrganizationMemberService; |
| | | |
| | | |
| | | /** |
| | | * 党组织成员 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入PartyOrganizationMember") |
| | | public R<PartyOrganizationMember> detail(PartyOrganizationMemberVO partyOrganizationVO) { |
| | | PartyOrganizationMember detail = partyOrganizationMemberService.getOne(Condition.getQueryWrapper(partyOrganizationVO)); |
| | | return R.data(detail); |
| | | } |
| | | |
| | | /** |
| | | * 党组织成员 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入PartyOrganizationMember") |
| | | public R<IPage<PartyOrganizationMemberVO>> page(PartyOrganizationMemberVO PartyOrganizationMemberVO, Query query) { |
| | | IPage<PartyOrganizationMemberVO> pages = partyOrganizationMemberService.getPage(Condition.getPage(query), PartyOrganizationMemberVO); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 党组织成员 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入PartyOrganizationMember") |
| | | public R save(@Valid @RequestBody PartyOrganizationMember PartyOrganizationMember) { |
| | | return R.status(partyOrganizationMemberService.save(PartyOrganizationMember)); |
| | | } |
| | | |
| | | /** |
| | | * 党组织成员 新增 |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入PartyOrganizationMember") |
| | | public R add(@Valid @RequestBody PartyOrganizationMemberVO PartyOrganizationMember) { |
| | | return R.status(partyOrganizationMemberService.addVO(PartyOrganizationMember)); |
| | | } |
| | | |
| | | /** |
| | | * 党组织成员 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入PartyOrganizationMember") |
| | | public R update(@Valid @RequestBody PartyOrganizationMember PartyOrganizationMember) { |
| | | return R.status(partyOrganizationMemberService.updateById(PartyOrganizationMember)); |
| | | } |
| | | |
| | | /** |
| | | * 党组织成员 修改 |
| | | */ |
| | | @PostMapping("/edit") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入PartyOrganizationMember") |
| | | public R edit(@Valid @RequestBody PartyOrganizationMemberVO PartyOrganizationMember) { |
| | | return R.status(partyOrganizationMemberService.editVO(PartyOrganizationMember)); |
| | | } |
| | | |
| | | /** |
| | | * 党组织成员 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入PartyOrganizationMember") |
| | | public R submit(@Valid @RequestBody PartyOrganizationMember PartyOrganizationMember) { |
| | | return R.status(partyOrganizationMemberService.saveOrUpdate(PartyOrganizationMember)); |
| | | } |
| | | |
| | | /** |
| | | * 党组织成员 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(partyOrganizationMemberService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 党组织成员 删除 |
| | | */ |
| | | @PostMapping("/delete") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R delete(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(partyOrganizationMemberService.delete(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("jczz_party_organization") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class PartyOrganization extends BaseEntity { |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | //社区id |
| | | private String areaId; |
| | | |
| | | //组织名称 |
| | | private String organizationName; |
| | | |
| | | //组织类型 |
| | | private String organizationType; |
| | | |
| | | //支部类型 |
| | | private String branchType; |
| | | |
| | | //负责人姓名 |
| | | private String chargePerson; |
| | | |
| | | //负责人手机号 |
| | | private String phone; |
| | | |
| | | //成立日期 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date establishmentDate; |
| | | |
| | | //图片 |
| | | private String urls; |
| | | |
| | | //排序 |
| | | private String sort; |
| | | |
| | | //简介 |
| | | private String profile; |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.mp.base.BaseEntity; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("jczz_party_organization_member") |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class PartyOrganizationMember extends BaseEntity { |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | //住户id |
| | | private String householdId; |
| | | |
| | | //党组织id |
| | | private String organizationId; |
| | | |
| | | //党员类型 |
| | | private String partyMemberType; |
| | | |
| | | //党员职务 |
| | | private String partyMemberPost; |
| | | |
| | | //入党日期 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date joinDate; |
| | | |
| | | //转入日期 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date transferDate; |
| | | |
| | | //签入社区日期 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date signInDate; |
| | | |
| | | //是否先锋岗(1、是;2、否) |
| | | private String isPioneer; |
| | | |
| | | //家庭住址 |
| | | private String address; |
| | | |
| | | //图片 |
| | | private String urls; |
| | | |
| | | //排序 |
| | | private String sort; |
| | | |
| | | //简介 |
| | | private String profile; |
| | | |
| | | private String userHouseLabelId; |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity; |
| | | import org.springblade.modules.ownersCommittee.vo.OwnersCommitteeVO; |
| | | import org.springblade.modules.ownersCommittee.wrapper.OwnersCommitteeWrapper; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | public interface PartyOrganizationMapper extends BaseMapper<PartyOrganization> { |
| | | |
| | | |
| | | List<PartyOrganizationVO> getPage(IPage<PartyOrganizationVO> page, @Param("vo") PartyOrganizationVO partyOrganizationVO); |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.partyOrganization.mapper.PartyOrganizationMapper"> |
| | | |
| | | |
| | | <select id="getPage" resultType="org.springblade.modules.partyOrganization.vo.PartyOrganizationVO"> |
| | | SELECT |
| | | DISTINCT |
| | | jpo.*, |
| | | IFNULL(countTable.memberCount ,0) as memberCount |
| | | FROM |
| | | jczz_party_organization jpo |
| | | LEFT JOIN ( SELECT COUNT(*) memberCount, organization_id FROM jczz_party_organization_member WHERE is_deleted = 0 ) countTable ON countTable.organization_id = jpo.id |
| | | left join jczz_party_organization_member jpom ON jpom.organization_id = jpo.id |
| | | left join jczz_household jh ON jh.id = jpom.household_id |
| | | WHERE |
| | | jpo.is_deleted = 0 |
| | | |
| | | <if test="vo.organizationName != null and vo.organizationName != ''"> |
| | | AND jpo.organization_name LIKE CONCAT('%',#{vo.organizationName},'%') |
| | | </if> |
| | | <if test="vo.areaId != null and vo.areaId !='' "> |
| | | AND jpo.area_id like concat('%',#{vo.areaId},'%') |
| | | </if> |
| | | <if test="vo.name != null and vo.name != ''"> |
| | | AND(jh.name LIKE CONCAT('%',#{vo.name},'%') OR jpo.charge_person LIKE CONCAT('%',#{vo.name},'%')) |
| | | </if> |
| | | ORDER BY |
| | | jpo.sort ASC |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganizationMember; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationMemberVO; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface PartyOrganizationMemberMapper extends BaseMapper<PartyOrganizationMember> { |
| | | |
| | | |
| | | List<PartyOrganizationMemberVO> getPage(IPage<PartyOrganizationMemberVO> page, @Param("vo") PartyOrganizationMemberVO partyOrganizationMemberVO); |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.partyOrganization.mapper.PartyOrganizationMemberMapper"> |
| | | |
| | | |
| | | <select id="getPage" resultType="org.springblade.modules.partyOrganization.vo.PartyOrganizationMemberVO"> |
| | | SELECT |
| | | jpom.*, |
| | | jh.name as houseHoldName, |
| | | jh.phone_number as phoneNumber, |
| | | jh.gender as gender, |
| | | jh.birthday as birthday, |
| | | jh.card_type as cardType, |
| | | jh.id_card as idCard |
| | | FROM jczz_party_organization_member jpom |
| | | LEFT JOIN jczz_household jh ON jpom.household_id = jh.id |
| | | where jpom.is_deleted = 0 |
| | | <if test="vo.organizationId != null and vo.organizationId !='' "> |
| | | AND jpom.organization_id = #{vo.organizationId} |
| | | </if> |
| | | <if test="vo.phoneNumber != null and vo.phoneNumber !='' "> |
| | | AND jh.phone_number LIKE CONCAT('%',#{vo.phoneNumber},'%') |
| | | </if> |
| | | <if test="vo.houseHoldName != null and vo.houseHoldName !='' "> |
| | | AND jh.name LIKE CONCAT('%',#{vo.houseHoldName},'%') |
| | | </if> |
| | | ORDER BY jpom.sort asc |
| | | </select> |
| | | </mapper> |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganizationMember; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationMemberVO; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IPartyOrganizationMemberService extends BaseService<PartyOrganizationMember> { |
| | | IPage<PartyOrganizationMemberVO> getPage(IPage<PartyOrganizationMemberVO> page, PartyOrganizationMemberVO partyOrganizationMemberVO); |
| | | |
| | | Boolean addVO(PartyOrganizationMemberVO partyOrganizationMember); |
| | | |
| | | Boolean editVO(PartyOrganizationMemberVO partyOrganizationMember); |
| | | |
| | | Boolean delete(List<Long> toLongList); |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | |
| | | public interface IPartyOrganizationService extends BaseService<PartyOrganization> { |
| | | IPage<PartyOrganizationVO> getPage(IPage<PartyOrganizationVO> page, PartyOrganizationVO partyOrganizationVO); |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| | | import org.springblade.modules.house.service.IUserHouseLabelService; |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganizationMember; |
| | | import org.springblade.modules.partyOrganization.mapper.PartyOrganizationMapper; |
| | | import org.springblade.modules.partyOrganization.mapper.PartyOrganizationMemberMapper; |
| | | import org.springblade.modules.partyOrganization.service.IPartyOrganizationMemberService; |
| | | import org.springblade.modules.partyOrganization.service.IPartyOrganizationService; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationMemberVO; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class PartyOrganizationMemberServiceImpl extends BaseServiceImpl<PartyOrganizationMemberMapper, PartyOrganizationMember> implements IPartyOrganizationMemberService { |
| | | |
| | | @Autowired |
| | | private IUserHouseLabelService userHouseLabelService; |
| | | |
| | | @Autowired |
| | | private ILabelService labelService; |
| | | |
| | | @Override |
| | | public IPage<PartyOrganizationMemberVO> getPage(IPage<PartyOrganizationMemberVO> page, PartyOrganizationMemberVO partyOrganizationMemberVO) { |
| | | return page.setRecords(baseMapper.getPage(page,partyOrganizationMemberVO)); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean addVO(PartyOrganizationMemberVO partyOrganizationMember) { |
| | | |
| | | UserHouseLabelEntity userHouseLabelEntity = new UserHouseLabelEntity(); |
| | | |
| | | userHouseLabelEntity.setHouseCode(partyOrganizationMember.getHouseCode()); |
| | | userHouseLabelEntity.setLabelId(Long.parseLong(partyOrganizationMember.getPartyMemberType())); |
| | | userHouseLabelEntity.setColor("#30D17C"); |
| | | userHouseLabelEntity.setLableType(1); |
| | | userHouseLabelEntity.setHouseholdId(Long.parseLong(partyOrganizationMember.getHouseholdId())); |
| | | userHouseLabelEntity.setCreateTime(DateUtil.now()); |
| | | |
| | | LabelEntity labelDetail = labelService.getById(partyOrganizationMember.getPartyMemberType()); |
| | | userHouseLabelEntity.setLabelName(labelDetail.getLabelName()); |
| | | |
| | | |
| | | boolean saveUserLabel = userHouseLabelService.save(userHouseLabelEntity); |
| | | |
| | | partyOrganizationMember.setUserHouseLabelId(userHouseLabelEntity.getId().toString()); |
| | | boolean saveMember = save(partyOrganizationMember); |
| | | return saveUserLabel&&saveMember; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean editVO(PartyOrganizationMemberVO partyOrganizationMember) { |
| | | |
| | | UserHouseLabelEntity userHouseLabelEntity = userHouseLabelService.getById(partyOrganizationMember.getUserHouseLabelId()); |
| | | |
| | | |
| | | //更新userhouselabel标签 |
| | | LabelEntity labelDetail = labelService.getById(partyOrganizationMember.getPartyMemberType()); |
| | | userHouseLabelEntity.setLabelName(labelDetail.getLabelName()); |
| | | userHouseLabelEntity.setLabelId(Long.parseLong(partyOrganizationMember.getPartyMemberType())); |
| | | boolean updateLabel = userHouseLabelService.updateById(userHouseLabelEntity); |
| | | |
| | | //更新党员信息 |
| | | boolean updateMember = updateById(partyOrganizationMember); |
| | | |
| | | |
| | | return updateLabel&&updateMember; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean delete(List<Long> toLongList) { |
| | | |
| | | //把userhouselabel中的数据删除 |
| | | List<PartyOrganizationMember> partyOrganizationMembers = listByIds(toLongList); |
| | | |
| | | //循环删除 |
| | | partyOrganizationMembers.forEach(partyOrganizationMember ->{ |
| | | userHouseLabelService.removeById(partyOrganizationMember.getUserHouseLabelId()); |
| | | }); |
| | | |
| | | //删自己 |
| | | return removeBatchByIds(toLongList); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.mapper.PartyOrganizationMapper; |
| | | import org.springblade.modules.partyOrganization.service.IPartyOrganizationService; |
| | | import org.springblade.modules.partyOrganization.vo.PartyOrganizationVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class PartyOrganizationServiceImpl extends BaseServiceImpl<PartyOrganizationMapper, PartyOrganization> implements IPartyOrganizationService { |
| | | |
| | | @Autowired |
| | | private IDeptService deptService; |
| | | @Override |
| | | public IPage<PartyOrganizationVO> getPage(IPage<PartyOrganizationVO> page, PartyOrganizationVO partyOrganizationVO) { |
| | | |
| | | Dept dept = deptService.getById(AuthUtil.getDeptId()); |
| | | if (null!=dept){ |
| | | partyOrganizationVO.setAreaId(dept.getRegionCode()); |
| | | } |
| | | return page.setRecords(baseMapper.getPage(page,partyOrganizationVO)); |
| | | } |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganizationMember; |
| | | |
| | | @Data |
| | | public class PartyOrganizationMemberVO extends PartyOrganizationMember { |
| | | |
| | | private String houseHoldName; |
| | | |
| | | private String phoneNumber; |
| | | |
| | | private String gender; |
| | | |
| | | private String birthday; |
| | | |
| | | |
| | | |
| | | private String cardType; |
| | | |
| | | private String idCard; |
| | | |
| | | //房屋code |
| | | private String houseCode; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.partyOrganization.vo; |
| | | |
| | | import lombok.Data; |
| | | import org.springblade.modules.partyOrganization.entity.PartyOrganization; |
| | | |
| | | @Data |
| | | public class PartyOrganizationVO extends PartyOrganization { |
| | | |
| | | //党员数 |
| | | private Integer memberCount; |
| | | |
| | | //负责人名字或者党成员名字 |
| | | private String name; |
| | | } |