Merge branch 'test' into 'master'
Test
See merge request root/zhihuishequ!13
| | |
| | | |
| | | @ApiOperation(value = "车辆登记") |
| | | @PostMapping("car/register") |
| | | public R addComMngCar(@RequestBody ComMngCarAppletDTO comMngCarAppletDTO) { |
| | | public R addComMngCar(@Validated(AddGroup.class) @RequestBody ComMngCarAppletDTO comMngCarAppletDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | if (null!=communityId && 0!=communityId) { |
| | |
| | | pageQuestnaireDTO.setForParty(1 == isPartymember.intValue()); |
| | | pageQuestnaireDTO.setForVolunteer(1 == isVolunteer.intValue()); |
| | | pageQuestnaireDTO.setUserId(loginUserInfo.getUserId()); |
| | | // pageQuestnaireDTO.setState(0); |
| | | return communityService.pageQuestnaire(pageQuestnaireDTO, loginUserInfo.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询社区调查问卷", response = QuestnaireListVo.class) |
| | | @PostMapping("/pageVolunteer") |
| | | public R pageVolunteer(@RequestBody PageQuestnaireDTO pageQuestnaireDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | pageQuestnaireDTO.setForMasses(null); |
| | | pageQuestnaireDTO.setForVolunteer(true); |
| | | pageQuestnaireDTO.setForParty(true); |
| | | return communityService.pageQuestnaire(pageQuestnaireDTO, loginUserInfo.getCommunityId()); |
| | | return communityService.pageQuestnaire(pageQuestnaireDTO, getLoginUserInfo().getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "创建调查问卷") |
| | |
| | | import com.panzhihua.applets.model.dtos.ComPbMemberCertificationDTO; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.model.dtos.shop.ExcelShopOrderDTO; |
| | | import com.panzhihua.common.constants.SecurityConstants; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.model.dtos.user.SysUserEditTipsDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | |
| | | private PartyBuildingService partyBuildingService; |
| | | @Resource |
| | | private CheckService checkService; |
| | | @Resource |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @ApiOperation(value = "当前登录用户信息", response = LoginUserInfoVO.class) |
| | | @GetMapping("info") |
| | |
| | | if (R.isOk(r1)) { |
| | | log.info("新增实名认证未通过通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | //清空缓存 |
| | | String userRoleKey = UserConstants.LOGIN_USER_INFO + this.getLoginUserInfo().getUserId(); |
| | | String userAppletRoleKey = SecurityConstants.ROLE_APPLETS_USER + this.getLoginUserInfo().getUserId(); |
| | | stringRedisTemplate.delete(userRoleKey); |
| | | stringRedisTemplate.delete(userAppletRoleKey); |
| | | } else { |
| | | //未通过发通知 |
| | | /** |
| | |
| | | @ApiOperation(value = "保存商家") |
| | | @PostMapping("/store/save") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R saveStore(@Validated(AddGroup.class) @RequestBody ShopStoreVO storeVO) { |
| | | public R saveStore(@Validated @RequestBody ShopStoreVO storeVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long loginUserId = loginUserInfo.getUserId(); |
| | | if (storeVO == null) { |
| | |
| | | public static final String APPLETS_ACCESS_MEDIA_ID ="APPLETS_ACCESS_MEDIA_ID";//小程序获取的access_token |
| | | public static final String APPLETS_ACCESS_MEDIA_ID_TIME ="APPLETS_ACCESS_MEDIA_ID_TIME";//小程序获取的access_token |
| | | |
| | | |
| | | public static final String ROLE_APPLETS_REAL_NAMED="applets:realnamed";//小程序用户实名角色 |
| | | public static final String ROLE_APPLETS_USER="applets:realnamed:user:";//小程序用户角色 |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 文化程度 |
| | | * |
| | | * @author huanghongfa |
| | | */ |
| | | @Getter |
| | | public enum PopulCultureLevelEnum |
| | | { |
| | | XX(1, "小学"), |
| | | CZ(2, "初中"), |
| | | GZ(3, "高中"), |
| | | ZZ(4, "中专"), |
| | | DZ(5, "大专"), |
| | | BK(6, "本科"), |
| | | SS(7, "硕士"), |
| | | BS(8, "博士"), |
| | | QT(9, "其他"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulCultureLevelEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulCultureLevelEnum item : PopulCultureLevelEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 9; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulCultureLevelEnum item : PopulCultureLevelEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "其他"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 婚姻状况 |
| | | * |
| | | * @author huanghongfa |
| | | */ |
| | | @Getter |
| | | public enum PopulMarriageEnum |
| | | { |
| | | WH(1, "未婚"), |
| | | YH(2, "已婚"), |
| | | LY(3, "离异"), |
| | | SO(4, "丧偶"), |
| | | FJ(5, "分居"), |
| | | QT(6, "其他"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulMarriageEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulMarriageEnum item : PopulMarriageEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 6; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulMarriageEnum item : PopulMarriageEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "其他"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 与户主关系 |
| | | * |
| | | * @author huanghongfa |
| | | */ |
| | | @Getter |
| | | public enum PopulRelationEnum |
| | | { |
| | | HZ(1, "户主"), |
| | | PO(2, "配偶"), |
| | | ZN(3, "子女"), |
| | | SN(4, "孙女"), |
| | | FM(5, "父母"), |
| | | QT(6, "其他"); |
| | | |
| | | private final Integer code; |
| | | private final String name; |
| | | |
| | | PopulRelationEnum(Integer code, String name) |
| | | { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | |
| | | public static int getCodeByName(String name) { |
| | | for (PopulRelationEnum item : PopulRelationEnum.values()) { |
| | | if (item.name.equals(name)) { |
| | | return item.getCode(); |
| | | } |
| | | } |
| | | return 6; |
| | | } |
| | | |
| | | public static String getCnDescByName(Integer code) { |
| | | for (PopulRelationEnum item : PopulRelationEnum.values()) { |
| | | if (item.code.equals(code)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return "其他"; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.PopulIsOkEnum; |
| | | import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; |
| | | import com.panzhihua.common.enums.PopulSexEnum; |
| | | import com.panzhihua.common.enums.*; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | vo.setIsRent(PopulIsOkEnum.getCodeByName(oneData.get(4))); |
| | | } |
| | | if(oneData.get(5) != null){ |
| | | vo.setRelation(oneData.get(5)); |
| | | vo.setRelation(PopulRelationEnum.getCodeByName(oneData.get(5))); |
| | | } |
| | | if(oneData.get(6) != null){ |
| | | vo.setRoad(oneData.get(6)); |
| | |
| | | vo.setNativePlace(oneData.get(12)); |
| | | } |
| | | if(oneData.get(13) != null){ |
| | | vo.setCultureLevel(oneData.get(13)); |
| | | vo.setCultureLevel(PopulCultureLevelEnum.getCodeByName(oneData.get(13))); |
| | | } |
| | | if(oneData.get(14) != null){ |
| | | vo.setMarriage(oneData.get(14)); |
| | | vo.setMarriage(PopulMarriageEnum.getCodeByName(oneData.get(14))); |
| | | } |
| | | if(oneData.get(15) != null){ |
| | | vo.setHealthy(oneData.get(15)); |
| | |
| | | if(oneData.get(16) != null){ |
| | | vo.setWorkCompany(oneData.get(16)); |
| | | } |
| | | if(oneData.get(17) != null){ |
| | | vo.setRemark(oneData.get(17)); |
| | | |
| | | if(oneData.get(17) != null && StringUtils.isNotEmpty(oneData.get(17))){ |
| | | String outOrLocal = oneData.get(17); |
| | | if(outOrLocal.equals(ComMngPopulationServeExcelVO.outOrLocal.bd)){ |
| | | vo.setOutOrLocal(1); |
| | | }else if(outOrLocal.equals(ComMngPopulationServeExcelVO.outOrLocal.wd)){ |
| | | vo.setOutOrLocal(2); |
| | | } |
| | | for (int i = 18; i < headSize; i++) { |
| | | } |
| | | if(oneData.get(18) != null){ |
| | | vo.setCensusRegister(oneData.get(18)); |
| | | } |
| | | if(oneData.get(19) != null){ |
| | | vo.setRemark(oneData.get(19)); |
| | | } |
| | | for (int i = 20; i < headSize; i++) { |
| | | if (oneData.get(i) != null && oneData.get(i).equals("是")) { |
| | | vo.getUserTagStr().add(headData.get(i)); |
| | | vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("("))); |
| | | } |
| | | } |
| | | voList.add(vo); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.PopulIsOkEnum; |
| | | import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; |
| | | import com.panzhihua.common.enums.PopulSexEnum; |
| | | import com.panzhihua.common.enums.*; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | |
| | | vo.setIsRent(PopulIsOkEnum.getCodeByName(oneData.get(4))); |
| | | } |
| | | if(oneData.get(5) != null){ |
| | | vo.setRelation(oneData.get(5)); |
| | | vo.setRelation(PopulRelationEnum.getCodeByName(oneData.get(5))); |
| | | } |
| | | if(oneData.get(6) != null){ |
| | | vo.setRoad(oneData.get(6)); |
| | |
| | | vo.setNativePlace(oneData.get(12)); |
| | | } |
| | | if(oneData.get(13) != null){ |
| | | vo.setCultureLevel(oneData.get(13)); |
| | | vo.setCultureLevel(PopulCultureLevelEnum.getCodeByName(oneData.get(13))); |
| | | } |
| | | if(oneData.get(14) != null){ |
| | | vo.setMarriage(oneData.get(14)); |
| | | vo.setMarriage(PopulMarriageEnum.getCodeByName(oneData.get(14))); |
| | | } |
| | | if(oneData.get(15) != null){ |
| | | vo.setHealthy(oneData.get(15)); |
| | |
| | | if(oneData.get(16) != null){ |
| | | vo.setWorkCompany(oneData.get(16)); |
| | | } |
| | | if(oneData.get(17) != null){ |
| | | vo.setRemark(oneData.get(17)); |
| | | |
| | | if(oneData.get(17) != null && StringUtils.isNotEmpty(oneData.get(17))){ |
| | | String outOrLocal = oneData.get(17); |
| | | if(outOrLocal.equals(ComMngPopulationServeExcelVO.outOrLocal.bd)){ |
| | | vo.setOutOrLocal(1); |
| | | }else if(outOrLocal.equals(ComMngPopulationServeExcelVO.outOrLocal.wd)){ |
| | | vo.setOutOrLocal(2); |
| | | } |
| | | for (int i = 18; i < headSize; i++) { |
| | | } |
| | | if(oneData.get(18) != null){ |
| | | vo.setCensusRegister(oneData.get(18)); |
| | | } |
| | | if(oneData.get(19) != null){ |
| | | vo.setRemark(oneData.get(19)); |
| | | } |
| | | for (int i = 20; i < headSize; i++) { |
| | | if (oneData.get(i) != null && oneData.get(i).equals("是")) { |
| | | vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("("))); |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.ListUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | |
| | | private static final int BATCH_COUNT = 100; |
| | | private static final int BATCH_COUNT = 5000; |
| | | private List<ComMngRealCompanyExcelVO> list = new ArrayList<>(); |
| | | |
| | | @Override |
| | | public void invoke(ComMngRealCompanyExcelVO comMngRealCompanyExcelVO, AnalysisContext analysisContext) { |
| | | if(StringUtils.isEmpty(comMngRealCompanyExcelVO.getCreditCode())){ |
| | | throw new ServiceException("统一社会信用代码不可为空"); |
| | | } |
| | | list.add(comMngRealCompanyExcelVO); |
| | | // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM |
| | | if(list.size() >= BATCH_COUNT){ |
| | |
| | | |
| | | @ApiModelProperty("商家名称") |
| | | @NotBlank(groups = {AddGroup.class},message = "商家名称不能为空") |
| | | @Length(groups = {AddGroup.class}, max = 35, message = "商家名称不能为空大于35个字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("联系人") |
| | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Length; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | |
| | | |
| | | @ApiModelProperty(value = "车牌号") |
| | | @NotBlank(groups = {AddGroup.class},message = "车牌号不能为空") |
| | | @Length(groups = {AddGroup.class}, max = 20,message = "车牌号长度错误") |
| | | private String plateNum; |
| | | |
| | | @ApiModelProperty(value = "车辆品牌型号") |
| | | @NotBlank(groups = {AddGroup.class},message = "车辆品牌型号不能为空") |
| | | @Length(groups = {AddGroup.class}, max = 20,message = "车辆品牌型号超长") |
| | | private String brand; |
| | | |
| | | @ApiModelProperty(value = "车身颜色") |
| | |
| | | */ |
| | | @ApiModelProperty(value="年龄") |
| | | private Integer age; |
| | | |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | |
| | | @ExcelProperty(value = "是否租住", index = 4) |
| | | private Integer isRent; |
| | | |
| | | @ExcelProperty(value = "与户主关系", index = 5) |
| | | private String relation; |
| | | @ExcelProperty(value = "与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)", index = 5) |
| | | private Integer relation; |
| | | |
| | | @ExcelProperty(value = "街路巷", index = 6) |
| | | private String road; |
| | |
| | | @ExcelProperty(value = "籍贯", index = 12) |
| | | private String nativePlace; |
| | | |
| | | @ExcelProperty(value = "文化程度", index = 13) |
| | | private String cultureLevel; |
| | | @ExcelProperty(value = "文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)", index = 13) |
| | | private Integer cultureLevel; |
| | | |
| | | @ExcelProperty(value = "婚姻状况", index = 14) |
| | | private String marriage; |
| | | @ExcelProperty(value = "婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)", index = 14) |
| | | private Integer marriage; |
| | | |
| | | @ExcelProperty(value = "健康状况", index = 15) |
| | | private String healthy; |
| | |
| | | @ExcelProperty(value = "工作单位", index = 16) |
| | | private String workCompany; |
| | | |
| | | @ExcelProperty(value = "备注", index = 17) |
| | | @ExcelProperty(value = "外地or本地(1.本地 2.外地)", index = 17) |
| | | private Integer outOrLocal; |
| | | |
| | | @ExcelProperty(value = "户口所在地", index = 18) |
| | | private String censusRegister; |
| | | |
| | | @ExcelProperty(value = "备注", index = 19) |
| | | private String remark; |
| | | |
| | | private Integer age; |
| | |
| | | */ |
| | | private List<String> userTagStr = Lists.newArrayList(); |
| | | |
| | | /** |
| | | * 外地or本地(1.本地 2.外地) |
| | | */ |
| | | public interface outOrLocal{ |
| | | String bd = "本地"; |
| | | String wd = "外地"; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("身份证号码") |
| | | @NotBlank(groups = {AddGroup.class},message = "身份证号码不可为空") |
| | | @EncryptDecryptField |
| | | @Sensitive(strategy = SensitiveStrategy.ID_CARD) |
| | | private String cardNo; |
| | | |
| | | @ApiModelProperty("出生年月") |
| | | private String birthday; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | @NotBlank(groups = {AddGroup.class},message = "街路巷不可为空") |
| | |
| | | @ApiModelProperty("修改时间") |
| | | private Date updateAt; |
| | | |
| | | |
| | | @ApiModelProperty("籍贯") |
| | | private String nativePlace; |
| | | |
| | |
| | | @ApiModelProperty("小区名字") |
| | | private String alley; |
| | | |
| | | @ApiModelProperty("户主关系") |
| | | @ApiModelProperty("户主关系列表") |
| | | private List<ComHouseMemberVo> comMngFamilyInfoVOS; |
| | | |
| | | @ApiModelProperty("家庭成员信息") |
| | |
| | | @NotBlank(groups = {AddGroup.class},message = "是否租住不可为空") |
| | | private Integer isRent; |
| | | |
| | | @ApiModelProperty("文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)") |
| | | private Integer cultureLevel; |
| | | |
| | | @ApiModelProperty("文化程度") |
| | | private String cultureLevel; |
| | | |
| | | |
| | | @ApiModelProperty("婚姻状况") |
| | | private String marriage; |
| | | |
| | | @ApiModelProperty("婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)") |
| | | private Integer marriage; |
| | | |
| | | @ApiModelProperty("健康状况") |
| | | private String healthy; |
| | | |
| | | @ApiModelProperty("外地or本地(1.本地 2.外地)") |
| | | private Integer outOrLocal; |
| | | |
| | | @ApiModelProperty("户口所在地") |
| | | private String censusRegister; |
| | | |
| | | @ApiModelProperty("与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)") |
| | | private Integer relation; |
| | | |
| | | public interface sex{ |
| | | int nan = 1; |
| | | int nv = 2; |
| | |
| | | * 实有人口Vo |
| | | */ |
| | | @Data |
| | | @ApiModel("实有人口表") |
| | | @ApiModel("实有人口编辑表") |
| | | @EncryptDecryptClass |
| | | public class EditComMngPopulationVO implements Serializable { |
| | | |
| | |
| | | @ApiModelProperty("小区名字") |
| | | private String alley; |
| | | |
| | | |
| | | @ApiModelProperty("是否租住 是否租住(0.否 1.是)") |
| | | @NotBlank(groups = {AddGroup.class},message = "是否租住不可为空") |
| | | private Integer isRent; |
| | | |
| | | @ApiModelProperty("文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)") |
| | | private Integer cultureLevel; |
| | | |
| | | @ApiModelProperty("文化程度") |
| | | private String cultureLevel; |
| | | |
| | | |
| | | @ApiModelProperty("婚姻状况") |
| | | private String marriage; |
| | | |
| | | @ApiModelProperty("婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)") |
| | | private Integer marriage; |
| | | |
| | | @ApiModelProperty("健康状况") |
| | | private String healthy; |
| | | |
| | | @ApiModelProperty("与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他)") |
| | | private Integer relation; |
| | | |
| | | @ApiModelProperty("外地or本地(1.本地 2.外地)") |
| | | private Integer outOrLocal; |
| | | |
| | | @ApiModelProperty("户口所在地") |
| | | private String censusRegister; |
| | | |
| | | public interface sex{ |
| | | int nan = 1; |
| | | int nv = 2; |
| | |
| | | |
| | | |
| | | @ApiModelProperty("店铺登陆账号") |
| | | //@Pattern(groups = {AddGroup.class}, message="【密码】格式为6-16个字符,英文,数字,且必须包含英文和数字",regexp="^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$") |
| | | //@Pattern(message="【密码】格式为6-16个字符,英文,数字,且必须包含英文和数字",regexp="^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$") |
| | | @NotBlank(message = "店铺登陆账号不能为空") |
| | | private String storeAccount; |
| | | |
| | |
| | | |
| | | |
| | | @ApiModelProperty("配送方式(1.商家配送 2.快递物流)") |
| | | @NotNull(message = "配送方式(1.商家配送 2.快递物流)") |
| | | @NotNull(message = "配送方式(1.商家配送 2.快递物流)不能为空") |
| | | private Integer deliveryType; |
| | | |
| | | |
| | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("商家简介") |
| | | @Size(max = 25,min = 1,message = "简介长度不符合!") |
| | | @Size(max = 25,min = 0,message = "简介长度不符合!") |
| | | private String storeDescribe; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | @ApiModelProperty(value = "用户id") |
| | | private Long userId; |
| | | |
| | | /** |
| | |
| | | import com.panzhihua.common.model.vos.shop.ShopOperLogVO; |
| | | import com.panzhihua.common.model.vos.shop.AddShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | */ |
| | | @PostMapping("/shop/conf/get") |
| | | R pageShopSysConf(@RequestBody PageComShopSysConfDTO pageComShopSysConfDTO); |
| | | |
| | | /** |
| | | * 编辑实有人口_电子档案 |
| | | * @param userElectronicFileVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/common/data/population/edit/electronicArchives") |
| | | R editUserElectronicFile(@RequestBody UserElectronicFileVO userElectronicFileVO); |
| | | } |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口编辑") |
| | | |
| | | @ApiOperation(value = "编辑实有人口") |
| | | @PostMapping(value = "/population/edit") |
| | | public R editPopulationInfo(@RequestBody EditComMngPopulationVO editComMngPopulationVO){ |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | |
| | | List<String> head17 = new ArrayList<String>(); |
| | | head17.add("工作单位"); |
| | | List<String> head18 = new ArrayList<String>(); |
| | | head18.add("备注"); |
| | | head18.add("本地/外地"); |
| | | List<String> head19 = new ArrayList<String>(); |
| | | head19.add("户口所在地"); |
| | | List<String> head20 = new ArrayList<String>(); |
| | | head20.add("备注"); |
| | | list.add(head0); |
| | | list.add(head1); |
| | | list.add(head2); |
| | |
| | | list.add(head16); |
| | | list.add(head17); |
| | | list.add(head18); |
| | | list.add(head19); |
| | | list.add(head20); |
| | | return list; |
| | | } |
| | | |
| | |
| | | data.add(""); |
| | | data.add(""); |
| | | data.add("阿里巴巴"); |
| | | data.add("本地"); |
| | | data.add("四川成都"); |
| | | data.add(""); |
| | | return data; |
| | | } |
| | |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "编辑实有人口_电子档案") |
| | | @PostMapping("/population/edit/electronicArchives") |
| | | R editPopulation(@RequestBody UserElectronicFileVO userElectronicFileVO){ |
| | | return communityService.editUserElectronicFile(userElectronicFileVO); |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiOperation(value = "编辑便民服务商家") |
| | | @PutMapping("/business/put") |
| | | public R putComCvtBusiness(@RequestBody ComCvtBusinessDTO comCvtBusinessDTO) { |
| | | public R putComCvtBusiness(@Validated(AddGroup.class) @RequestBody ComCvtBusinessDTO comCvtBusinessDTO) { |
| | | return communityService.putComCvtBusiness(comCvtBusinessDTO); |
| | | } |
| | | |
| | |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.service_community.service.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/car/save") |
| | | public R saveComMngCar(@RequestBody ComMngCarSaveDTO comMngCarSaveDTO) { |
| | | public R saveComMngCar(@Validated({AddGroup.class}) @RequestBody ComMngCarSaveDTO comMngCarSaveDTO) { |
| | | return comMngCarService.saveComMngCar(comMngCarSaveDTO); |
| | | } |
| | | |
| | |
| | | * @param Ids 删除id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "批量删除实有人口") |
| | | @PostMapping("/population/delete") |
| | | public R deletePopulations(@RequestBody List<Long> Ids) { |
| | | return comMngPopulationService.deletePopulations(Ids); |
| | |
| | | * @param communityId 社区id |
| | | * @return 查询结果 |
| | | */ |
| | | @ApiOperation(value = "根据社区id查询所有实有人口") |
| | | @PostMapping("/population/getAll") |
| | | public R getPopulationListByCommunityId(@RequestParam(value = "communityId") Long communityId) { |
| | | return comMngPopulationService.getPopulationListByCommunityId(communityId); |
| | |
| | | * @param Ids 实有人口id集合 |
| | | * @return 查询结果 |
| | | */ |
| | | @ApiOperation(value = "批量删除实有人口") |
| | | @PostMapping("/population/getList") |
| | | public R getPopulationLists(@RequestBody List<Long> Ids) { |
| | | return comMngPopulationService.getPopulationLists(Ids); |
| | |
| | | public R deleteSpecialInputUser(@RequestParam(value = "id") Long id){ |
| | | return comMngPopulationService.deleteSpecialInputUser(id); |
| | | } |
| | | |
| | | /** |
| | | * 编辑实有人口_电子档案 |
| | | * @param userElectronicFileVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/population/edit/electronicArchives") |
| | | R editPopulation(@RequestBody UserElectronicFileVO userElectronicFileVO){ |
| | | return comMngPopulationService.editUserElectronicFile(userElectronicFileVO); |
| | | } |
| | | |
| | | } |
| | |
| | | " </if> " + |
| | | " </where>" + |
| | | " group by w.id \n"+ |
| | | "ORDER BY w.`status` asc, w.create_at desc "+ |
| | | "ORDER BY w.create_at desc "+ |
| | | "</script>") |
| | | IPage<ComActMicroWishVO> pageMicroWish(Page page, @Param("comActMicroWishVO") ComActMicroWishVO comActMicroWishVO); |
| | | @Select("SELECT\n" + |
| | |
| | | " from com_act_neighbor_circle_comment_reply as reply" + |
| | | " left join sys_user su1 on su1.user_id = reply.user_id " + |
| | | " left join sys_user su2 on su2.user_id = reply.parent_user_id " + |
| | | " where reply.comment_id = #{commentId} order by create_at desc" + |
| | | " where reply.status = 1 and reply.comment_id = #{commentId} order by create_at desc" + |
| | | " </script>") |
| | | List<ComActNeighborCircleCommentReplyAppVO> getCircleCommentReplyList(@Param("commentId") Long commentId); |
| | | |
| | |
| | | " LEFT JOIN com_act t1 ON t.community_id = t1.community_id " + |
| | | " LEFT JOIN com_mng_struct_area t2 ON t2.id = t.area_id " + |
| | | " LEFT JOIN sys_user t3 ON t.create_by = t3.user_id " + |
| | | " WHERE t.source =2 " + |
| | | " WHERE 1=1" + |
| | | "<if test='pageComMngCarDTO.name != null and pageComMngCarDTO.name.trim() != ""'>" + |
| | | " and t.user_name LIKE concat( '%',#{pageComMngCarDTO.name}, '%' ) " + |
| | | " </if> " + |
| | |
| | | "cmp.native_place,\n" + |
| | | "cmp.nation, \n" + |
| | | "cmp.label, \n" + |
| | | "cmp.relation, \n" + |
| | | "cmp.marriage, \n" + |
| | | "cmp.culture_level, \n" + |
| | | "cmp.out_or_local, \n" + |
| | | "cmp.census_register, \n" + |
| | | "cmp.is_rent \n" + |
| | | "FROM \n" + |
| | | "com_mng_population AS cmp " + |
| | |
| | | @Select("select user_id,card_photo_front,card_photo_back,family_book from sys_user where id_card=#{idCard}") |
| | | UserElectronicFileVO getSysUserElectronicFile(@Param("idCard") String idCard); |
| | | |
| | | @Select("select user_id,card_photo_front,card_photo_back,family_book from sys_user where user_id=#{userId}") |
| | | UserElectronicFileVO getSysUserById(@Param("userId") Long userId); |
| | | |
| | | @Select("update sys_user set card_photo_front=#{vo.cardPhotoFront},card_photo_back=#{vo.cardPhotoBack},family_book=#{vo.familyBook} where user_id=#{vo.userId}") |
| | | void updateSysUserElectronicFile(@Param("vo") UserElectronicFileVO vo); |
| | | } |
| | |
| | | @EncryptDecryptField |
| | | private String phone; |
| | | /** |
| | | * 外地or本地(1.本地 2.外地) |
| | | */ |
| | | private Integer outOrLocal; |
| | | /** |
| | | * 户口所在地 |
| | | */ |
| | | private String censusRegister; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | private String remark; |
| | |
| | | private String villageName; |
| | | |
| | | /** |
| | | * 与户主关系 |
| | | * 与户主关系(1.户主 2.配偶 3.子女 4.孙女 5.父母 6.其他) |
| | | */ |
| | | private String relation; |
| | | private Integer relation; |
| | | |
| | | /** |
| | | * 文化程度 |
| | | * 文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他) |
| | | */ |
| | | private String cultureLevel; |
| | | private Integer cultureLevel; |
| | | |
| | | /** |
| | | * 婚姻状况 |
| | | * 婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他) |
| | | */ |
| | | private String marriage; |
| | | private Integer marriage; |
| | | |
| | | /** |
| | | * 健康状况 |
| | |
| | | int no = 13; |
| | | } |
| | | |
| | | /** |
| | | * 外地or本地(1.本地 2.外地) |
| | | */ |
| | | public interface outOrLocal{ |
| | | int bd = 1; |
| | | int wd = 2; |
| | | } |
| | | |
| | | } |
| | |
| | | private Long receiverId; |
| | | |
| | | /** |
| | | * 删除状态(1.未删除 2.已删除) |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | private Integer deleteStatus; |
| | | |
| | |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.community.EditComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | | R electronicArchivesPopulation(Long populationId); |
| | | |
| | | /** |
| | | * 编辑电子档案 |
| | | * @param userElectronicFileVO |
| | | * @return |
| | | */ |
| | | R editUserElectronicFile(UserElectronicFileVO userElectronicFileVO); |
| | | } |
| | |
| | | /*if(now.getTime()<comActActivityVO.getBeginAt().getTime()){ |
| | | comActActivityDO.setStatus(3); |
| | | }*/ |
| | | if(status.intValue()==2) {//点击‘保存并发布’ 按钮 |
| | | //报名结束时间大于当前时间则设置为“进行中” |
| | | if(comActActivityVO.getSignUpEnd()!=null && now.getTime()<comActActivityVO.getSignUpEnd().getTime()){ |
| | | comActActivityDO.setStatus(4); |
| | | } |
| | | } |
| | | |
| | | boolean save = this.save(comActActivityDO); |
| | | if(!save){ |
| | |
| | | */ |
| | | @Override |
| | | public R addDynamicUser(Long id, Long userId) { |
| | | ComActDynUserDO comActDynUserDO = comActDynUserDAO.selectOne(new QueryWrapper<ComActDynUserDO>().lambda().eq(ComActDynUserDO::getDynId, id).eq(ComActDynUserDO::getUserId, userId)); |
| | | if (ObjectUtils.isEmpty(comActDynUserDO)) { |
| | | comActDynUserDO=new ComActDynUserDO(); |
| | | ComActDynUserDO comActDynUserDO = new ComActDynUserDO(); |
| | | comActDynUserDO.setCreateAt(new Date()); |
| | | comActDynUserDO.setDynId(id); |
| | | comActDynUserDO.setUserId(userId); |
| | |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | }else{ |
| | | List<Long> areaIds = comCvtBusinessAreaService.getBusinessServiceAreaIds(comCvtBusinessDO.getId()); |
| | | if(!ObjectUtils.isEmpty(areaIds)){ |
| | | List<ComActDO> busiDO = comActDAO.selectBatchIds(areaIds); |
| | | comActDOS = comActDAO.selectBatchIds(areaIds); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | Map<String, Long> businessMap = getBusinessMap(comCvtBusinessDOS); |
| | | list.forEach(comCvtServeExcelVO -> { |
| | | /** |
| | | * 便民服务分类存在 并且 便民服务商家 匹配上 |
| | | */ |
| | | if (categoryMap.containsKey(comCvtServeExcelVO.getCategoryName()) && businessMap.containsKey(comCvtServeExcelVO.getBusinessName())) { |
| | | ComCvtServeDO comCvtServeDO = new ComCvtServeDO(); |
| | | BeanUtils.copyProperties(comCvtServeExcelVO, comCvtServeDO); |
| | |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComMngPopulationVO> iPage = populationDAO.pagePopulation(page, comMngPopulationVO); |
| | | iPage.getRecords().forEach(vo->{ |
| | | //获取用户生日 |
| | | String date = vo.getCardNo().substring(6, 14); |
| | | String year = date.substring(0,4); |
| | | String month = date.substring(4,6); |
| | | String day = date.substring(6,8); |
| | | String birthday = year + "-" + month + "-" + day; |
| | | //设置用户年龄 |
| | | vo.setBirthday(birthday); |
| | | }); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R editUserElectronicFile(UserElectronicFileVO userElectronicFileVO) { |
| | | UserElectronicFileVO electronicFileVO = populationDAO.getSysUserById(userElectronicFileVO.getUserId()); |
| | | if(electronicFileVO==null){ |
| | | return R.fail("id有误!"); |
| | | } |
| | | populationDAO.updateSysUserElectronicFile(userElectronicFileVO); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | //查询默认收货地址 |
| | | //查询上次购买记录的收货地址 |
| | | List<ComShopOrderDO> shopOrders = this.baseMapper.selectList(new QueryWrapper<ComShopOrderDO>() |
| | | .eq("user_id",orderPreviewDTO.getUserId()).orderByDesc("create_at")); |
| | | if(shopOrders.isEmpty()){//未查询到用户上一笔订单 |
| | | //查询用户收货地址中的默认地址 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectOne(new QueryWrapper<ComShopUserAddressDO>() |
| | | ComShopUserAddressDO userDefaultAddressDO = comShopUserAddressDAO.selectOne(new QueryWrapper<ComShopUserAddressDO>() |
| | | .eq("delete_status", 2) |
| | | .eq("user_id",orderPreviewDTO.getUserId()).eq("is_default",ComShopUserAddressDO.isDefault.yes)); |
| | | |
| | | //查询用户收货地址中的默认地址 |
| | | if(userDefaultAddressDO != null){ |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | BeanUtils.copyProperties(userDefaultAddressDO,userAddressVO); |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | }else{ |
| | | //查询上次购买记录的收货地址 |
| | | //查询到用户上一笔订单 |
| | | List<ComShopOrderDO> shopOrders = this.baseMapper.selectList(new QueryWrapper<ComShopOrderDO>() |
| | | .eq("delete_status", 2) |
| | | .eq("user_id",orderPreviewDTO.getUserId()) |
| | | .orderByDesc("create_at")); |
| | | if(shopOrders!=null && shopOrders.size()>0) { |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(shopOrders.get(0).getReceiverId()); |
| | | if(userAddressDO != null){ |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | BeanUtils.copyProperties(userAddressDO,userAddressVO); |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | }else{ |
| | | } |
| | | } |
| | | //无默认地址, 无上一单记录 地址 |
| | | /* |
| | | if(orderPreviewVO.getUserAddressVO()==null){ |
| | | List<ComShopUserAddressDO> userAddressDOList = comShopUserAddressDAO.selectList(new QueryWrapper<ComShopUserAddressDO>() |
| | | .eq("user_id",orderPreviewDTO.getUserId()).orderByDesc("create_at")); |
| | | if(!userAddressDOList.isEmpty()){ |
| | |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | } |
| | | } |
| | | }else{//查询到用户上一笔订单 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(shopOrders.get(0).getReceiverId()); |
| | | if(userAddressDO != null){ |
| | | if(userAddressDO.getDeleteStatus() == 2) { |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | BeanUtils.copyProperties(userAddressDO, userAddressVO); |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | */ |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | return R.ok(orderPreviewVO); |
| | | } |
| | | |
| | |
| | | public R shopStoreDetail(PageComShopStoreDTO comShopStoreDTO) { |
| | | //查询店铺 |
| | | ComShopStoreDO storeDO = this.baseMapper.selectById(comShopStoreDTO.getStoreId()); |
| | | if (storeDO == null) { |
| | | boolean storeDeleted = storeDO!=null && 2==storeDO.getDeleteStatus(); |
| | | if (storeDO == null || storeDeleted) { |
| | | return R.fail(401, "店铺不存在"); |
| | | } |
| | | if (storeDO.getStatus().equals(ComShopStoreDO.status.no)) { |
| | |
| | | comPbActivityDO.setEnrollTimeBegin(now); |
| | | comPbActivityDO.setCreateAt(now); |
| | | |
| | | Integer status = partyBuildingActivityVO.getStatus(); |
| | | if(status!=null && status.intValue()==2) {//点击'保存并发布' 按钮 |
| | | //默认设置为“进行中” |
| | | comPbActivityDO.setStatus(4); |
| | | } |
| | | |
| | | int insert = comBpActivityDAO.insert(comPbActivityDO); |
| | | if (insert > 0) { |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.exceptions.PartyBuildingMemberException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActActivityVO; |
| | |
| | | if (delete>0) { |
| | | // 维护用户表党员状态 |
| | | comPbMemberDAO.updateUserIsPartymember(comPbMemberDO.getIdCard()); |
| | | //删除缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + comPbMemberDO.getUserId(); |
| | | stringRedisTemplate.delete(userKey); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | loginUserInfoVO.setIsmemberrole(1); |
| | | } |
| | | } |
| | | loginUserInfoVO.setIsRealNamed(sysUserDO.getIdCard()!=null); |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public R putUserIsVolunteer(String phone, int type) { |
| | | |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | sysUserDO.setIsVolunteer(type); |
| | | //????根据手机号匹配 |
| | | int update = userDao.update(sysUserDO, new UpdateWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, phone)); |
| | | if (update > 0) { |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO = userDao.selectVolunteerMngByPhone(phone); |
| | | if(comMngVolunteerMngVO!=null&&comMngVolunteerMngVO.getSubmitUserId()!=null) { |
| | | Long userId = comMngVolunteerMngVO.getSubmitUserId(); |
| | | //删除用户信息缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | stringRedisTemplate.delete(userKey); |
| | | }else{ |
| | | List<SysUserDO> userDOList = userDao.selectList(new LambdaQueryWrapper<SysUserDO>().eq(SysUserDO::getPhone, phone)); |
| | | if(userDOList!=null && userDOList.size()>0){ |
| | | userDOList.forEach(usrDo ->{ |
| | | Long userId = usrDo.getUserId(); |
| | | //删除用户信息缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | stringRedisTemplate.delete(userKey); |
| | | }); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | } |
| | | int update = userDao.updateById(sysUserDO); |
| | | if (update > 0) { |
| | | //删除用户信息缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | stringRedisTemplate.delete(userKey); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | sysUserDO.setName(name); |
| | | sysUserDO.setIdCard(idCard); |
| | | sysUserDO.setSex(loginUserInfoVO.getSex()); |
| | | sysUserDO.setBirthday(loginUserInfoVO.getBirthday()); |
| | | //通过身份证号判断性别以及出生日期 |
| | | sysUserDO.setSex(IdCard.sex(idCard)); |
| | | sysUserDO.setBirthday(IdCard.birthDay(idCard)); |
| | | sysUserDO.setJob(loginUserInfoVO.getJob()); |
| | | sysUserDO.setUserId(loginUserInfoVO.getUserId()); |
| | | sysUserDO.setFaceUrl(loginUserInfoVO.getFaceUrl()); |
| | |
| | | SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getIdCard,idCard).eq(SysUserDO::getType,1)); |
| | | if(sysUserDO != null){ |
| | | sysUserDO.setIsPartymember(1); |
| | | userDao.updateById(sysUserDO); |
| | | int updated = userDao.updateById(sysUserDO); |
| | | if(updated>0){ |
| | | //删除用户信息缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + sysUserDO.getUserId(); |
| | | stringRedisTemplate.delete(userKey); |
| | | } |
| | | log.info("新增党员修改用户党员状态成功 身份证号【{}】", idCard); |
| | | } |
| | | return R.ok(); |
| | |
| | | SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getIdCard,idCard).eq(SysUserDO::getType,1)); |
| | | if(sysUserDO != null){ |
| | | sysUserDO.setIsPartymember(0); |
| | | userDao.updateById(sysUserDO); |
| | | int updated = userDao.updateById(sysUserDO); |
| | | if(updated>0) { |
| | | //删除用户信息缓存 |
| | | String userKey = UserConstants.LOGIN_USER_INFO + sysUserDO.getUserId(); |
| | | stringRedisTemplate.delete(userKey); |
| | | } |
| | | log.info("新增党员修改用户为非党员状态成功 身份证号【{}】", idCard); |
| | | } |
| | | return R.ok(); |
New file |
| | |
| | | package com.panzhihua.zuul.config; |
| | | |
| | | import com.panzhihua.common.constants.SecurityConstants; |
| | | import com.panzhihua.zuul.filters.AppletAuthenticationFilter; |
| | | import org.springframework.boot.autoconfigure.security.SecurityProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| | | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; |
| | | import org.springframework.security.web.authentication.AnonymousAuthenticationFilter; |
| | | |
| | | /** |
| | | * @ClasssName AppletWebSecurityConfigurationAdapter |
| | | * @Description 小程序 |
| | | * @Author cedoo |
| | | * @Date 2021/4/30 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Configuration |
| | | @Order(SecurityProperties.BASIC_AUTH_ORDER-2) |
| | | public class AppletWebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter { |
| | | @Override |
| | | protected void configure(HttpSecurity http) throws Exception { |
| | | http.antMatcher("/api/applets/**").authorizeRequests() |
| | | .anyRequest().authenticated() |
| | | .and() |
| | | .addFilterAfter(new AppletAuthenticationFilter(), AnonymousAuthenticationFilter.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.zuul.config; |
| | | |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @ConfigurationProperties(prefix = "applet.realname") |
| | | @Data |
| | | public class RealNamedConfig { |
| | | |
| | | private List<String> verify; |
| | | |
| | | } |
| | |
| | | */ |
| | | @Resource |
| | | private UserAuthAccessDeniedHandler userAuthAccessDeniedHandler; |
| | | |
| | | @Override |
| | | protected void configure(HttpSecurity http) throws Exception { |
| | | http.authorizeRequests() |
| | |
| | | // 禁用缓存 |
| | | http.headers().cacheControl(); |
| | | http.addFilterBefore(new JWTAuthenticationTokenFilter(), AnonymousAuthenticationFilter.class); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.zuul.filters; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.panzhihua.common.constants.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.JWTTokenUtil; |
| | | import com.panzhihua.common.utlis.ResultUtil; |
| | | import com.panzhihua.zuul.config.RealNamedConfig; |
| | | import io.jsonwebtoken.Claims; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.security.core.authority.SimpleGrantedAuthority; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.context.support.WebApplicationContextUtils; |
| | | |
| | | import javax.servlet.*; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicBoolean; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 小程序权限验证 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-25 16:35 |
| | | **/ |
| | | @Component |
| | | public class AppletAuthenticationFilter implements Filter { |
| | | private StringRedisTemplate stringRedisTemplate; |
| | | |
| | | @Autowired |
| | | private RealNamedConfig realNamedConfig; |
| | | |
| | | |
| | | @Override |
| | | public void init(FilterConfig filterConfig) throws ServletException { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 用户是否登录校验 |
| | | * |
| | | * @param servletRequest 请求 |
| | | * @param servletResponse 返回 |
| | | * @param filterChain 过滤器链条 |
| | | * @throws IOException io |
| | | * @throws ServletException servlet |
| | | */ |
| | | @Override |
| | | public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { |
| | | HttpServletRequest request = (HttpServletRequest) servletRequest; |
| | | SafeboxRequestWrapper safeboxRequestWrapper = new SafeboxRequestWrapper(request); |
| | | HttpServletResponse response = (HttpServletResponse) servletResponse; |
| | | |
| | | // 获取请求头中JWT的Token |
| | | String tokenHeader = request.getHeader(TokenConstant.TOKEN_HEADER); |
| | | if (null != tokenHeader && tokenHeader.startsWith(TokenConstant.TOKEN_PRE) |
| | | &&realNamedConfig!=null && realNamedConfig.getVerify()!=null &&realNamedConfig.getVerify().size()>0) { |
| | | String token = tokenHeader.replace(TokenConstant.TOKEN_PRE, ""); |
| | | |
| | | // token解析 |
| | | Claims claims = JWTTokenUtil.getClaimsFromToken(token); |
| | | if(claims!=null) {//检查token有效 |
| | | String username = claims.getSubject(); |
| | | int type = (Integer) claims.get("type"); |
| | | if (1 == type) {//小程序用户统一角色 |
| | | String requestURI = request.getRequestURI(); |
| | | String requestMethod = request.getMethod().toLowerCase(); |
| | | |
| | | ServletContext context = request.getServletContext(); |
| | | ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context); |
| | | stringRedisTemplate = ctx.getBean(StringRedisTemplate.class); |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String appletUserRoleKey = SecurityConstants.ROLE_APPLETS_USER + username; |
| | | Boolean userHasRole = stringRedisTemplate.hasKey(appletUserRoleKey); |
| | | |
| | | boolean needCheck = false; |
| | | List<String> checkedUrl = realNamedConfig.getVerify(); |
| | | checkedUrl = checkedUrl != null ? checkedUrl : new ArrayList<>(); |
| | | for (int i = 0; i < checkedUrl.size(); i++) { |
| | | String url = checkedUrl.get(i); |
| | | if (url.toLowerCase().startsWith(requestMethod) && url.endsWith(requestURI)) { |
| | | needCheck = true; |
| | | } else { |
| | | continue; |
| | | } |
| | | } |
| | | if (needCheck) { |
| | | if (userHasRole) { |
| | | boolean userHashRight = false; |
| | | try { |
| | | String roles = valueOperations.get(appletUserRoleKey); |
| | | List<SimpleGrantedAuthority> authorities = JSONArray.parseArray(roles, SimpleGrantedAuthority.class); |
| | | if (authorities != null && authorities.size() > 0) { |
| | | AtomicBoolean userHasRightRole = new AtomicBoolean(false); |
| | | authorities.forEach(authority -> { |
| | | if (authority.getAuthority().equals(SecurityConstants.ROLE_APPLETS_REAL_NAMED)) { |
| | | userHasRightRole.set(true); |
| | | } |
| | | }); |
| | | if (userHasRightRole.get()) { |
| | | //用户包含“已实名”角色,则放行 什么也不做 |
| | | userHashRight = true; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | userHashRight = false; |
| | | } |
| | | |
| | | if (!userHashRight) { |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.FORBIDDEN, "用户未实名")); |
| | | return; |
| | | } |
| | | } else { |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.FORBIDDEN, "用户未实名")); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | filterChain.doFilter(servletRequest, servletResponse); |
| | | } |
| | | |
| | | @Override |
| | | public void destroy() { |
| | | |
| | | } |
| | | } |
| | |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败"));
|
| | | return;
|
| | | }
|
| | | String username = claims.getSubject();
|
| | | String userId = claims.getSubject(); |
| | | int type = (Integer) claims.get("type");
|
| | | if (ObjectUtils.isEmpty(username)) {
|
| | | if (ObjectUtils.isEmpty(userId)) { |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.UNAUTHORIZED, "token校验失败"));
|
| | | return;
|
| | | }
|
| | | List<SimpleGrantedAuthority> authorities = new ArrayList<>();
|
| | | List<SimpleGrantedAuthority> authorities1 = new ArrayList<>();
|
| | | String key = SecurityConstants.ROLE_USER + username;
|
| | | Boolean aBoolean = stringRedisTemplate.hasKey(key);
|
| | | if (1 == type) {//小程序用户统一角色
|
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS));
|
| | | String roleAppletKey = SecurityConstants.ROLE_APPLETS_USER +userId; |
| | | if(stringRedisTemplate.hasKey(roleAppletKey)){ |
| | | String roles = valueOperations.get(roleAppletKey); |
| | | authorities = JSONArray.parseArray(roles, SimpleGrantedAuthority.class); |
| | | } else {
|
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS)); |
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | Boolean hasKeyLoginUserInfo = stringRedisTemplate.hasKey(userKey); |
| | | if (hasKeyLoginUserInfo) { |
| | | String userInfo = valueOperations.get(userKey); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class); |
| | | //判断用户是否已实名制 |
| | | if (loginUserInfoVO.getIsRealNamed() != null && loginUserInfoVO.getIsRealNamed()) { |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS_REAL_NAMED)); |
| | | } |
| | | }else{ |
| | | //查询登陆用户信息 |
| | | R<LoginUserInfoVO> r = userService.getUserInfoByUserId(userId); |
| | | if (!R.isOk(r)) { |
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.ERROR, "登录用户信息查询失败")); |
| | | return; |
| | | } |
| | | LoginUserInfoVO data = r.getData(); |
| | | //判断用户是否已实名制 |
| | | if (data.getIsRealNamed() != null && data.getIsRealNamed()) { |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS_REAL_NAMED)); |
| | | } |
| | | } |
| | | valueOperations.set(roleAppletKey, JSONArray.toJSONString(authorities), 24, TimeUnit.HOURS); |
| | | } |
| | | } else { |
| | | String key = SecurityConstants.ROLE_USER + userId; |
| | | Boolean aBoolean = stringRedisTemplate.hasKey(key); |
| | | if (aBoolean) {
|
| | | String roles = valueOperations.get(key);
|
| | | authorities = JSONArray.parseArray(roles, SimpleGrantedAuthority.class);
|
| | | } else {
|
| | | R<List<String>> r = userService.getUserRoles(username);
|
| | | R<List<String>> r = userService.getUserRoles(userId); |
| | | List<String> data =(List<String>)r.getData();
|
| | | if (!ObjectUtils.isEmpty(data)) {
|
| | | data.forEach(s -> {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(username, username, authorities);//主要使用权限 账户 密码 不重要
|
| | | UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(userId, userId, authorities);//主要使用权限 账户 密码 不重要 |
| | | SecurityContextHolder.getContext().setAuthentication(authentication);
|
| | | safeboxRequestWrapper.addHeader(TokenConstant.TOKEN_LOGOUT,tokenHeader);
|
| | | //登录用户的所有信息
|
| | | String userKey = UserConstants.LOGIN_USER_INFO + username;
|
| | | String userKey = UserConstants.LOGIN_USER_INFO + userId; |
| | | Boolean hasKeyLoginUserInfo = stringRedisTemplate.hasKey(userKey);
|
| | | if(hasKeyLoginUserInfo){
|
| | | String userInfo = valueOperations.get(userKey);
|
| | |
| | | String hexStr = AES.parseByte2HexStr(encrypt);
|
| | | safeboxRequestWrapper.addHeader(TokenConstant.TOKEN_USERINFO, hexStr);
|
| | | }else{
|
| | | R<LoginUserInfoVO> r = userService.getUserInfoByUserId(username);
|
| | | R<LoginUserInfoVO> r = userService.getUserInfoByUserId(userId); |
| | | if (!R.isOk(r)) {
|
| | | ResultUtil.responseJson(response, R.fail(HttpStatus.ERROR, "登录用户信息查询失败"));
|
| | | return;
|
| | |
| | | service-url: |
| | | defaultZone: http://${EUREKA_URL:localhost}:8192/eureka |
| | | |
| | | |
| | | |
| | | # applet 需实名认证的接口地址 |
| | | applet: |
| | | realname: |
| | | verify: |
| | | - POST:/api/applets/house |
| | | - POST:/api/applets/putHouse |
| | | - POST:/api/applets/undercarriageHouse |
| | | - GET:/api/applets/delHouse |
| | | - POST:/api/applets/questnaire/add |
| | | - GET:/api/applets/questnaire/delete |
| | | - POST:/api/applets/questnaire/edit |
| | | - GET:/api/applets/questnaire/stat/details |
| | | - POST:/api/applets/questnaire/toggle |
| | | - POST:/api/applets/questnaire/stat/answer |
| | | - POST:/api/applets/index/comacteasyphotocomment |
| | | - POST:/api/applets/index/commentsign |
| | | - POST:/api/applets/index/addmessageback |
| | | - POST:/api/applets/index/addmessage |
| | | - POST:/api/applets/index/easyphoto |
| | | - PUT:/api/applets/index/easyphoto |
| | | - POST:/api/applets/index/microwish |
| | | - PUT:/api/applets/index/microwish |
| | | - POST:/api/applets/discuss |
| | | - POST:/api/applets/discusscommentback |
| | | - POST:/api/applets/discusscomment |
| | | - PUT:/api/applets/discusscommentuser |
| | | - POST:/api/applets/discussuser |
| | | - PUT:/api/applets/discussuser |
| | | - POST:/api/applets/neighbor/addNeighborByApp |
| | | - POST:/api/applets/neighbor/cancel/fabulous |
| | | - POST:/api/applets/neighbor/comment |
| | | - POST:/api/applets/neighbor/fabulous |
| | | - POST:/api/applets/neighbor/reply |
| | | - PUT:/api/applets/community/signactivity |
| | | - POST:/api/applets/community/volunteer |
| | | - POST:/api/applets/user/houses |
| | | - POST:/api/appletsbackstage/common/data/car/save |
| | | - DELETE:/api/appletsbackstage/common/data/car/delete |
| | | - POST:/api/applets/community/car/register |
| | | - PUT:/api/applets/partybuilding/activitysignup |
| | | - GET:/api/applets/questnaire/stat |
| | | - GET:/api/applets/questnaire/view |
| | | - POST:/api/applets/user/addfamily |
| | | - PUT:/api/applets/user/putfamily |
| | | - POST:/api/applets/user/getUserArchives |
| | | - POST:/api/applets/user/updateUserArchives |
| | | - POST:/api/applets/user/partybuildingembercertification |
| | | - GET:/api/applets/user/partybuildingembercertification |
| | | - GET:/api/applets/index/pagemymessage |
| | | - POST:/api/applets/index/pagemymessage |
| | | - POST:/api/applets/user/listactivity |
| | | - POST:/api/applets/partybuilding/activityinfo |
| | | - PUT:/api/applets/user/microwishconfirm |
| | | - POST:/api/applets/user/pagemicrowish |
| | | - POST:/api/applets/user/pageeasyphoto |
| | | - POST:/api/applets/neighbor/user/page |
| | | - GET:/api/applets/user/listfamily |