Commit 24182b73 authored by mengmeng's avatar mengmeng

Merge branch 'Shen' into 'master'

Shen

See merge request !17
parents 447b86e6 9ab971d9
package io.hmit.modules.serviceOrder.controller;
import io.hmit.common.annotation.LogOperation;
import io.hmit.common.constant.Constant;
import io.hmit.common.page.PageData;
import io.hmit.common.utils.ExcelUtils;
import io.hmit.common.utils.Result;
import io.hmit.common.validator.AssertUtils;
import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.excel.PensionOldFamilyExcel;
import io.hmit.modules.serviceOrder.service.PensionOldFamilyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@RestController
@RequestMapping("serviceOrder/pensionoldfamily")
@Api(tags="老人与家属的关联表")
public class PensionOldFamilyController {
@Autowired
private PensionOldFamilyService pensionOldFamilyService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
@RequiresPermissions("serviceOrder:pensionoldfamily:page")
public Result<PageData<PensionOldFamilyDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOldFamilyDTO> page = pensionOldFamilyService.page(params);
return new Result<PageData<PensionOldFamilyDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@RequiresPermissions("serviceOrder:pensionoldfamily:info")
public Result<PensionOldFamilyDTO> get(@PathVariable("id") Long id){
PensionOldFamilyDTO data = pensionOldFamilyService.get(id);
return new Result<PensionOldFamilyDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@RequiresPermissions("serviceOrder:pensionoldfamily:save")
public Result save(@RequestBody PensionOldFamilyDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
pensionOldFamilyService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@RequiresPermissions("serviceOrder:pensionoldfamily:update")
public Result update(@RequestBody PensionOldFamilyDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
pensionOldFamilyService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@RequiresPermissions("serviceOrder:pensionoldfamily:delete")
public Result delete(@RequestBody Long[] ids){
//校验数据
AssertUtils.isArrayEmpty(ids, "id");
pensionOldFamilyService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@RequiresPermissions("serviceOrder:pensionoldfamily:export")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PensionOldFamilyDTO> list = pensionOldFamilyService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PensionOldFamilyExcel.class);
}
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.entity.PensionOldFamilyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Mapper
public interface PensionOldFamilyDao extends BaseDao<PensionOldFamilyEntity> {
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Data
@ApiModel(value = "老人与家属的关联表")
public class PensionOldFamilyDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private Long id;
@ApiModelProperty(value = "老人id")
private Long oldId;
@ApiModelProperty(value = "老人与家属的关系")
private String parentRole;
@ApiModelProperty(value = "家属id")
private Long familyMemberId;
@ApiModelProperty(value = "家属与老人的关系")
private String familyMemberRole;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "更新者")
private Long updater;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("pension_old_family")
public class PensionOldFamilyEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 老人id
*/
private Long oldId;
/**
* 老人与家属的关系
*/
private String parentRole;
/**
* 家属id
*/
private Long familyMemberId;
/**
* 家属与老人的关系
*/
private String familyMemberRole;
/**
* 备注
*/
private String remark;
/**
* 更新者
*/
private Long updater;
/**
* 更新时间
*/
private Date updateDate;
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Data
public class PensionOldFamilyExcel {
@Excel(name = "")
private Long id;
@Excel(name = "老人id")
private Long oldId;
@Excel(name = "老人与家属的关系")
private String parentRole;
@Excel(name = "家属id")
private Long familyMemberId;
@Excel(name = "家属与老人的关系")
private String familyMemberRole;
@Excel(name = "备注")
private String remark;
@Excel(name = "创建者")
private Long creator;
@Excel(name = "创建时间")
private Date createDate;
@Excel(name = "更新者")
private Long updater;
@Excel(name = "更新时间")
private Date updateDate;
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.service;
import io.hmit.common.service.CrudService;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.entity.PensionOldFamilyEntity;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
public interface PensionOldFamilyService extends CrudService<PensionOldFamilyEntity, PensionOldFamilyDTO> {
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.serviceOrder.dao.PensionOldFamilyDao;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.entity.PensionOldFamilyEntity;
import io.hmit.modules.serviceOrder.service.PensionOldFamilyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Service
public class PensionOldFamilyServiceImpl extends CrudServiceImpl<PensionOldFamilyDao, PensionOldFamilyEntity, PensionOldFamilyDTO> implements PensionOldFamilyService {
@Override
public QueryWrapper<PensionOldFamilyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<PensionOldFamilyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}
\ No newline at end of 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="io.hmit.modules.serviceOrder.dao.PensionOldFamilyDao">
<resultMap type="io.hmit.modules.serviceOrder.entity.PensionOldFamilyEntity" id="pensionOldFamilyMap">
<result property="id" column="id"/>
<result property="oldId" column="old_id"/>
<result property="parentRole" column="parent_role"/>
<result property="familyMemberId" column="family_member_id"/>
<result property="familyMemberRole" column="family_member_role"/>
<result property="remark" column="remark"/>
<result property="creator" column="creator"/>
<result property="createDate" column="create_date"/>
<result property="updater" column="updater"/>
<result property="updateDate" column="update_date"/>
</resultMap>
</mapper>
\ No newline at end of file
...@@ -27,7 +27,7 @@ public class SwaggerConfig { ...@@ -27,7 +27,7 @@ public class SwaggerConfig {
@Bean @Bean
public Docket createRestApi() { public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
.host("byyl.zjhmit.com") // .host("byyl.zjhmit.com")
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
//加了ApiOperation注解的类,才生成接口文档 //加了ApiOperation注解的类,才生成接口文档
......
...@@ -13,6 +13,7 @@ import io.hmit.service.UserService; ...@@ -13,6 +13,7 @@ import io.hmit.service.UserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
...@@ -24,6 +25,8 @@ import java.util.Map; ...@@ -24,6 +25,8 @@ import java.util.Map;
* *
* @author zsh 408538940@qq.com * @author zsh 408538940@qq.com
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("/api") @RequestMapping("/api")
@Api(tags = "登录接口") @Api(tags = "登录接口")
...@@ -48,6 +51,17 @@ public class ApiLoginController { ...@@ -48,6 +51,17 @@ public class ApiLoginController {
return new Result().ok(map); return new Result().ok(map);
} }
@GetMapping("login")
@ApiOperation("登录")
public Result<Map<String, Object>> login(@RequestParam("openid") String openid) {
log.info("【微信网页授权】openId={}", openid);
//用户登录
Map<String, Object> map = userService.login(openid);
return new Result().ok(map);
}
@Login @Login
@PostMapping("logout") @PostMapping("logout")
@ApiOperation("退出") @ApiOperation("退出")
......
package io.hmit.controller;
import ch.qos.logback.core.pattern.ConverterUtil;
import io.hmit.annotation.Login;
import io.hmit.annotation.LoginUser;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.common.utils.Result;
import io.hmit.dto.OrgUserInfoDTO;
import io.hmit.dto.ServiceUserInfoDTO;
import io.hmit.dto.UserInfoDTO;
import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.service.PensionOldFamilyService;
import io.hmit.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* @Description :
* @Author : Shen Yuanfeng
* @Date: 2021/3/17 16:35
*/
@Slf4j
@RestController
@RequestMapping("api/user")
@Api(tags = "用户接口")
public class UserController {
@Autowired
private UserService userService;
@Autowired
private PensionOldFamilyService pensionOldFamilyService;
@Login
@GetMapping("oldinfo")
@ApiOperation("老人个人信息")
public Result<UserInfoDTO> getOldInfo(@ApiIgnore @LoginUser UserEntity user){
UserInfoDTO userDetails = userService.getUserDetails(user.getId());
return new Result<UserInfoDTO>().ok(userDetails);
}
@Login
@GetMapping("oldfamilyinfo")
@ApiOperation("老人家属信息")
public Result<List<PensionOldFamilyDTO>> getOldFamilyInfo(@ApiIgnore @LoginUser UserEntity user){
List<PensionOldFamilyDTO> familyDTOS = pensionOldFamilyService.findByOldId(user.getId());
return new Result<List<PensionOldFamilyDTO>>().ok(familyDTOS);
}
@Login
@GetMapping("orginfo")
@ApiOperation("机构信息")
public Result<OrgUserInfoDTO> getOrgUserInfo(@ApiIgnore @LoginUser UserEntity user){
OrgUserInfoDTO orgUserInfo = userService.getOrgUserByUserId(user.getId());
return new Result<OrgUserInfoDTO>().ok(orgUserInfo);
}
@Login
@GetMapping("serviceinfo")
@ApiOperation("服务人员信息")
public Result<ServiceUserInfoDTO> serviceinfo(@ApiIgnore @LoginUser UserEntity user){
ServiceUserInfoDTO serviceUser = userService.getServiceUserByUserId(user.getId());
return new Result<ServiceUserInfoDTO>().ok(serviceUser);
}
}
package io.hmit.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.api.WxConsts;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.net.URLEncoder;
/**
* @Description :
* @Author : Shen Yuanfeng
* @Date: 2021/3/17 15:32
*/
@Slf4j
@Controller
@RequestMapping("/wechat")
@Api(tags = "微信登录接口")
public class WeChatController {
@Autowired
private WxMpService wxMpService;
@GetMapping("/authorize")
@ApiOperation(value = "请求微信授权code", notes = "当returnUrl传入时,验证后将跳转到此路径")
public String authorize(@RequestParam(value = "returnUrl", required = false) String returnUrl) {
if (null == returnUrl) {
returnUrl = "https://byyl.zjhmit.com/hmit-api/api/login";
}
String url = "https://byyl.zjhmit.com/hmit-api/wechat/authcode";
String redirectUrl = wxMpService.oauth2buildAuthorizationUrl(url, WxConsts.OAUTH2_SCOPE_BASE, URLEncoder.encode(returnUrl));
log.info("【微信网页授权】获取code,redirectUrl={}", redirectUrl);
return "redirect:" + redirectUrl;
}
@GetMapping("/authcode")
public String userInfo(@RequestParam("code") String code,
@RequestParam("state") String returnUrl) {
log.info("【微信网页授权】code={}, returnUrl={}", code, returnUrl);
WxMpOAuth2AccessToken wxMpOAuth2AccessToken = new WxMpOAuth2AccessToken();
try {
wxMpOAuth2AccessToken = wxMpService.oauth2getAccessToken(code);
}catch (WxErrorException e){
log.error("【微信网页授权】错误{}",e.getMessage());
}
String openid = wxMpOAuth2AccessToken.getOpenId();
return "redirect:" + returnUrl + "?openid=" + openid;
}
}
package io.hmit.dao; package io.hmit.dao;
import io.hmit.common.dao.BaseDao; import io.hmit.common.dao.BaseDao;
import io.hmit.dto.OrgUserInfoDTO;
import io.hmit.dto.ServiceUserInfoDTO;
import io.hmit.entity.UserEntity; import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.UserRoleInfoDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
...@@ -18,6 +21,14 @@ public interface UserDao extends BaseDao<UserEntity> { ...@@ -18,6 +21,14 @@ public interface UserDao extends BaseDao<UserEntity> {
UserEntity getUserByUserId(Long userId); UserEntity getUserByUserId(Long userId);
UserEntity getUserByOpenId(String openId);
List<Long> getAllOrganizationStaff(Long userId); List<Long> getAllOrganizationStaff(Long userId);
OrgUserInfoDTO getOrgUserByUserId(Long userId);
ServiceUserInfoDTO getServiceUserByUserId(Long userId);
List<UserRoleInfoDTO> getUserRoleInfo(Long userId);
} }
package io.hmit.dto;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @Description :
* @Author : Shen Yuanfeng
* @Date: 2021/3/18 16:01
*/
@Data
@ApiModel(value = "老人信息")
public class OldUserInfoDTO { @ApiModelProperty(value = "用户id")
private Long id;
/**
* 用户名
*/
@ApiModelProperty(value = "用户名")
private String username;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
private String mobile;
/**
* 性别
*/
@ApiModelProperty(value = "性别")
private String gender;
/**
* 生日
*/
@ApiModelProperty(value = "生日")
private Date birthday;
/**
* 地址_地区
*/
@ApiModelProperty(value = "地址_地区")
private String addressArea;
/**
* 详细地址
*/
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "所属社区名称")
private String communityName;
@ApiModelProperty(value = "身体状态")
private String healthStatus;
@ApiModelProperty(value = "家属信息")
private List<PensionOldFamilyDTO> pensionOldFamilyDTOList;
}
package io.hmit.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/1/27
*/
@Data
@ApiModel(value = "机构信息")
public class OrgUserInfoDTO {
@ApiModelProperty(value = "用户id")
private Long id;
@ApiModelProperty(value = "用户名")
private String username;
@ApiModelProperty(value = "手机号")
private String mobile;
@ApiModelProperty(value = "机构名称")
private String name;
@ApiModelProperty(value = "机构图标")
private String icon;
@ApiModelProperty(value = "机构描述")
private String description;
@ApiModelProperty(value = "服务区域")
private String serviceArea;
}
package io.hmit.dto;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/1/27
*/
@Data
@ApiModel(value = "用户信息")
public class ServiceUserInfoDTO {
@ApiModelProperty(value = "用户id")
private Long id;
/**
* 用户名
*/
@ApiModelProperty(value = "用户名")
private String username;
/**
* 手机号
*/
@ApiModelProperty(value = "手机号")
private String mobile;
/**
* 性别
*/
@ApiModelProperty(value = "性别")
private String gender;
/**
* 生日
*/
@ApiModelProperty(value = "生日")
private Date birthday;
/**
* 地址_地区
*/
@ApiModelProperty(value = "地址_地区")
private String addressArea;
/**
* 详细地址
*/
@ApiModelProperty(value = "详细地址")
private String address;
/**
* 机构ID
*/
@ApiModelProperty(value = "机构ID")
private String orgId;
/**
* 机构名称
*/
@ApiModelProperty(value = "机构ID")
private String orgName;
/**
* 服务区域
*/
@ApiModelProperty(value = "服务区域")
private String serviceArea;
}
package io.hmit.dto; package io.hmit.dto;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author Eve * @author Eve
...@@ -27,6 +29,11 @@ public class UserInfoDTO { ...@@ -27,6 +29,11 @@ public class UserInfoDTO {
*/ */
@ApiModelProperty(value = "手机号") @ApiModelProperty(value = "手机号")
private String mobile; private String mobile;
/**
* 性别
*/
@ApiModelProperty(value = "性别")
private String gender;
/** /**
* 生日 * 生日
*/ */
...@@ -49,13 +56,7 @@ public class UserInfoDTO { ...@@ -49,13 +56,7 @@ public class UserInfoDTO {
@ApiModelProperty(value = "身体状态") @ApiModelProperty(value = "身体状态")
private String healthStatus; private String healthStatus;
@ApiModelProperty(value = "联系家属姓名") @ApiModelProperty(value = "家属信息")
private String familyMemberName; private List<PensionOldFamilyDTO> pensionOldFamilyDTOList;
@ApiModelProperty(value = "家属身份")
private String familyMemberRole;
@ApiModelProperty(value = "家属联系电话")
private String familyMemberTel;
} }
...@@ -50,6 +50,10 @@ public class UserEntity implements Serializable { ...@@ -50,6 +50,10 @@ public class UserEntity implements Serializable {
* 微信openid * 微信openid
*/ */
private String openid; private String openid;
/**
* 性别
*/
private String gender;
/** /**
* 生日 * 生日
*/ */
...@@ -70,18 +74,18 @@ public class UserEntity implements Serializable { ...@@ -70,18 +74,18 @@ public class UserEntity implements Serializable {
* 身体状态 * 身体状态
*/ */
private String healthStatus; private String healthStatus;
/** // /**
* 联系家属姓名 // * 联系家属姓名
*/ // */
private String familyMemberName; // private String familyMemberName;
/** // /**
* 家属身份 // * 家属身份
*/ // */
private String familyMemberRole; // private String familyMemberRole;
/** // /**
* 家属联系电话 // * 家属联系电话
*/ // */
private String familyMemberTel; // private String familyMemberTel;
/** /**
* 所属社区Id * 所属社区Id
*/ */
......
package io.hmit.modules.serviceOrder.controller;
import io.hmit.common.constant.Constant;
import io.hmit.common.page.PageData;
import io.hmit.common.utils.Result;
import io.hmit.common.validator.AssertUtils;
import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.service.PensionOldFamilyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@RestController
@RequestMapping("serviceOrder/pensionoldfamily")
@Api(tags="老人与家属的关联表")
public class PensionOldFamilyController {
@Autowired
private PensionOldFamilyService pensionOldFamilyService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
public Result<PageData<PensionOldFamilyDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOldFamilyDTO> page = pensionOldFamilyService.page(params);
return new Result<PageData<PensionOldFamilyDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
public Result<PensionOldFamilyDTO> get(@PathVariable("id") Long id){
PensionOldFamilyDTO data = pensionOldFamilyService.get(id);
return new Result<PensionOldFamilyDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
public Result save(@RequestBody PensionOldFamilyDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
pensionOldFamilyService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
public Result update(@RequestBody PensionOldFamilyDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
pensionOldFamilyService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
public Result delete(@RequestBody Long[] ids){
//校验数据
AssertUtils.isArrayEmpty(ids, "id");
pensionOldFamilyService.delete(ids);
return new Result();
}
}
\ No newline at end of file
...@@ -226,7 +226,8 @@ public class PensionOrderController { ...@@ -226,7 +226,8 @@ public class PensionOrderController {
try { try {
todto = URLDecoder.decode(dto,"UTF-8"); todto = URLDecoder.decode(dto,"UTF-8");
}catch (Exception ignored){} }catch (Exception ignored){}
StaffFinishDTO staffFinishDTO = JSON.parseObject(todto.substring(4), StaffFinishDTO.class); // StaffFinishDTO staffFinishDTO = JSON.parseObject(todto.substring(4), StaffFinishDTO.class);
StaffFinishDTO staffFinishDTO = JSON.parseObject(todto, StaffFinishDTO.class);
pensionOrderService.staffFinishedOrder(staffFinishDTO); pensionOrderService.staffFinishedOrder(staffFinishDTO);
return new Result(); return new Result();
} }
...@@ -317,7 +318,7 @@ public class PensionOrderController { ...@@ -317,7 +318,7 @@ public class PensionOrderController {
try { try {
todto = URLDecoder.decode(dto,"UTF-8"); todto = URLDecoder.decode(dto,"UTF-8");
}catch (Exception ignored){} }catch (Exception ignored){}
ReservationDTO reservationDTO = JSON.parseObject(todto.substring(4), ReservationDTO.class); ReservationDTO reservationDTO = JSON.parseObject(todto, ReservationDTO.class);
PensionOrderDTO data = new PensionOrderDTO().assemblePensionOrder(reservationDTO,user); PensionOrderDTO data = new PensionOrderDTO().assemblePensionOrder(reservationDTO,user);
data.setCommunityId(user.getCommunityId()); data.setCommunityId(user.getCommunityId());
......
...@@ -74,7 +74,7 @@ public class PensionOrderEvaluationController { ...@@ -74,7 +74,7 @@ public class PensionOrderEvaluationController {
try { try {
todto = URLDecoder.decode(dto,"UTF-8"); todto = URLDecoder.decode(dto,"UTF-8");
}catch (Exception ignored){} }catch (Exception ignored){}
PensionOrderEvaluationDTO pensionOrderEvaluationDTO = JSON.parseObject(todto.substring(4), PensionOrderEvaluationDTO.class); PensionOrderEvaluationDTO pensionOrderEvaluationDTO = JSON.parseObject(todto, PensionOrderEvaluationDTO.class);
pensionOrderEvaluationDTO.setFile(StringUtils.join(pensionOrderEvaluationDTO.getFiles(), ",")); pensionOrderEvaluationDTO.setFile(StringUtils.join(pensionOrderEvaluationDTO.getFiles(), ","));
pensionOrderEvaluationService.save(pensionOrderEvaluationDTO); pensionOrderEvaluationService.save(pensionOrderEvaluationDTO);
......
package io.hmit.modules.serviceOrder.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.entity.PensionOldFamilyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Mapper
public interface PensionOldFamilyDao extends BaseDao<PensionOldFamilyEntity> {
List<PensionOldFamilyDTO> findByOldId(Long oldId);
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Data
@ApiModel(value = "老人与家属的关联表")
public class PensionOldFamilyDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private Long id;
@ApiModelProperty(value = "老人id")
private Long oldId;
@ApiModelProperty(value = "老人与家属的关系")
private String parentRole;
@ApiModelProperty(value = "家属id")
private Long familyMemberId;
@ApiModelProperty(value = "家属与老人的关系")
private String familyMemberRole;
@ApiModelProperty(value = "手机号")
private String mobile;
@ApiModelProperty(value = "身份证号")
private String idCardNo;
@ApiModelProperty(value = "备注")
private String remark;
}
\ No newline at end of file
...@@ -31,6 +31,9 @@ public class PensionOrganizationDTO implements Serializable { ...@@ -31,6 +31,9 @@ public class PensionOrganizationDTO implements Serializable {
@ApiModelProperty(value = "机构描述") @ApiModelProperty(value = "机构描述")
private String description; private String description;
@ApiModelProperty(value = "服务区域")
private String serviceArea;
@ApiModelProperty(value = "创建者") @ApiModelProperty(value = "创建者")
private Long creator; private Long creator;
......
package io.hmit.modules.serviceOrder.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Description :
* @Author : Shen Yuanfeng
* @Date: 2021/3/19 15:06
*/
@Data
@ApiModel(value = "用户角色信息")
public class UserRoleInfoDTO {
@ApiModelProperty(value = "角色ID")
private String roleId;
@ApiModelProperty(value = "角色名称")
private String roleName;
}
package io.hmit.modules.serviceOrder.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("pension_old_family")
public class PensionOldFamilyEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 老人id
*/
private Long oldId;
/**
* 老人与家属的关系
*/
private String parentRole;
/**
* 家属id
*/
private Long familyMemberId;
/**
* 家属与老人的关系
*/
private String familyMemberRole;
/**
* 备注
*/
private String remark;
/**
* 更新者
*/
private Long updater;
/**
* 更新时间
*/
private Date updateDate;
}
\ No newline at end of file
...@@ -31,4 +31,9 @@ public class PensionOrganizationEntity extends BaseEntity { ...@@ -31,4 +31,9 @@ public class PensionOrganizationEntity extends BaseEntity {
* 机构描述 * 机构描述
*/ */
private String description; private String description;
/**
* 服务区域
*/
private String serviceArea;
} }
\ No newline at end of file
package io.hmit.modules.serviceOrder.service;
import io.hmit.common.service.CrudService;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.entity.PensionOldFamilyEntity;
import java.util.List;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
public interface PensionOldFamilyService extends CrudService<PensionOldFamilyEntity, PensionOldFamilyDTO> {
List<PensionOldFamilyDTO> findByOldId(Long oldId);
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.serviceOrder.dao.PensionOldFamilyDao;
import io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO;
import io.hmit.modules.serviceOrder.entity.PensionOldFamilyEntity;
import io.hmit.modules.serviceOrder.service.PensionOldFamilyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* 老人与家属的关联表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-18
*/
@Service
public class PensionOldFamilyServiceImpl extends CrudServiceImpl<PensionOldFamilyDao, PensionOldFamilyEntity, PensionOldFamilyDTO> implements PensionOldFamilyService {
@Override
public QueryWrapper<PensionOldFamilyEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<PensionOldFamilyEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
@Autowired
private PensionOldFamilyDao pensionOldFamilyDao;
@Override
public List<PensionOldFamilyDTO> findByOldId(Long oldId) {
return pensionOldFamilyDao.findByOldId(oldId);
}
}
\ No newline at end of file
...@@ -89,7 +89,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -89,7 +89,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
save(pensionOrderDTO); save(pensionOrderDTO);
PensionOrderServiceDTO orderServiceDTO = new PensionOrderServiceDTO().assemblePensionOrderService(pensionOrderDTO); PensionOrderServiceDTO orderServiceDTO = new PensionOrderServiceDTO().assemblePensionOrderService(pensionOrderDTO);
pensionOrderServiceService.save(orderServiceDTO); pensionOrderServiceService.save(orderServiceDTO);
// pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid()); pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid());
// pushMessage.sendSMSMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid()); // pushMessage.sendSMSMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid());
} }
......
...@@ -3,6 +3,9 @@ package io.hmit.service; ...@@ -3,6 +3,9 @@ package io.hmit.service;
import io.hmit.common.page.PageData; import io.hmit.common.page.PageData;
import io.hmit.common.service.BaseService; import io.hmit.common.service.BaseService;
import io.hmit.dto.LoginDTO; import io.hmit.dto.LoginDTO;
import io.hmit.dto.OrgUserInfoDTO;
import io.hmit.dto.ServiceUserInfoDTO;
import io.hmit.dto.UserInfoDTO;
import io.hmit.entity.UserEntity; import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO; import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
...@@ -17,8 +20,12 @@ public interface UserService extends BaseService<UserEntity> { ...@@ -17,8 +20,12 @@ public interface UserService extends BaseService<UserEntity> {
UserEntity getByMobile(String mobile); UserEntity getByMobile(String mobile);
UserEntity getByOpenId(String mobile);
UserEntity getUserByUserId(Long userId); UserEntity getUserByUserId(Long userId);
UserInfoDTO getUserDetails(Long userId);
/** /**
* 用户登录 * 用户登录
* *
...@@ -27,6 +34,18 @@ public interface UserService extends BaseService<UserEntity> { ...@@ -27,6 +34,18 @@ public interface UserService extends BaseService<UserEntity> {
*/ */
Map<String, Object> login(LoginDTO dto); Map<String, Object> login(LoginDTO dto);
/**
* 用户登录
*
* @param openid 免登
* @return 返回登录信息
*/
Map<String, Object> login(String openid);
PageData<UserEntity> getOrganizationAllUsers(Map<String, Object> params, Long userId); PageData<UserEntity> getOrganizationAllUsers(Map<String, Object> params, Long userId);
OrgUserInfoDTO getOrgUserByUserId(Long userId);
ServiceUserInfoDTO getServiceUserByUserId(Long userId);
} }
...@@ -45,11 +45,16 @@ public class PushMessageImpl implements PushMessage { ...@@ -45,11 +45,16 @@ public class PushMessageImpl implements PushMessage {
templateMessage.setTemplateId(wechatAccountConfig.getTemplateId()); templateMessage.setTemplateId(wechatAccountConfig.getTemplateId());
templateMessage.setToUser(openId); templateMessage.setToUser(openId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
String appointmentTime = sdf.format(pensionOrderDTO.getAppointmentTime());
List<WxMpTemplateData> data = Arrays.asList( List<WxMpTemplateData> data = Arrays.asList(
new WxMpTemplateData("first", "订单预约成功!"), new WxMpTemplateData("first", "【智慧养老】您的订单提醒"),
new WxMpTemplateData("keyword1", pensionOrderDTO.getServiceName()), new WxMpTemplateData("keyword1", pensionOrderDTO.getServiceName()),
new WxMpTemplateData("keyword2", pensionOrderDTO.getAppointmentTime().toString()), new WxMpTemplateData("keyword2", pensionOrderDTO.getId().toString()),
new WxMpTemplateData("keyword3", pensionOrderDTO.getStatusName()) new WxMpTemplateData("keyword3", pensionOrderDTO.getServiceName()),
new WxMpTemplateData("keyword4", appointmentTime),
new WxMpTemplateData("remark", "备注:" + pensionOrderDTO.getRemark())
); );
templateMessage.setData(data); templateMessage.setData(data);
try{ try{
...@@ -62,8 +67,6 @@ public class PushMessageImpl implements PushMessage { ...@@ -62,8 +67,6 @@ public class PushMessageImpl implements PushMessage {
@Override @Override
public void sendSMSMsg(PensionOrderDTO pensionOrderDTO, String receiver) { public void sendSMSMsg(PensionOrderDTO pensionOrderDTO, String receiver) {
try { try {
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfYMD = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdfYMD = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdfHms = new SimpleDateFormat("HH:mm:ss"); SimpleDateFormat sdfHms = new SimpleDateFormat("HH:mm:ss");
String ymd = sdfYMD.format(pensionOrderDTO.getAppointmentTime()); String ymd = sdfYMD.format(pensionOrderDTO.getAppointmentTime());
......
...@@ -6,11 +6,17 @@ import io.hmit.common.exception.ErrorCode; ...@@ -6,11 +6,17 @@ import io.hmit.common.exception.ErrorCode;
import io.hmit.common.exception.HmitException; import io.hmit.common.exception.HmitException;
import io.hmit.common.page.PageData; import io.hmit.common.page.PageData;
import io.hmit.common.service.impl.BaseServiceImpl; import io.hmit.common.service.impl.BaseServiceImpl;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.common.validator.AssertUtils; import io.hmit.common.validator.AssertUtils;
import io.hmit.dao.UserDao; import io.hmit.dao.UserDao;
import io.hmit.dto.LoginDTO; import io.hmit.dto.LoginDTO;
import io.hmit.dto.OrgUserInfoDTO;
import io.hmit.dto.ServiceUserInfoDTO;
import io.hmit.dto.UserInfoDTO;
import io.hmit.entity.TokenEntity; import io.hmit.entity.TokenEntity;
import io.hmit.entity.UserEntity; import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.UserRoleInfoDTO;
import io.hmit.modules.serviceOrder.service.PensionOldFamilyService;
import io.hmit.service.TokenService; import io.hmit.service.TokenService;
import io.hmit.service.UserService; import io.hmit.service.UserService;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
...@@ -31,19 +37,34 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -31,19 +37,34 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
@Autowired @Autowired
private UserDao userDao; private UserDao userDao;
@Autowired
private PensionOldFamilyService pensionOldFamilyService;
@Override @Override
public UserEntity getByMobile(String mobile) { public UserEntity getByMobile(String mobile) {
return baseDao.getUserByMobile(mobile); return baseDao.getUserByMobile(mobile);
} }
@Override
public UserEntity getByOpenId(String openId) {
return baseDao.getUserByOpenId(openId);
}
@Override @Override
public UserEntity getUserByUserId(Long userId) { public UserEntity getUserByUserId(Long userId) {
return baseDao.getUserByUserId(userId); return baseDao.getUserByUserId(userId);
} }
@Override @Override
public Map<String, Object> login(LoginDTO dto) { public UserInfoDTO getUserDetails(Long userId) {
UserEntity user = userDao.getUserByUserId(userId);
UserInfoDTO userInfoDTO = ConvertUtils.sourceToTarget(user, UserInfoDTO.class);
userInfoDTO.setPensionOldFamilyDTOList(pensionOldFamilyService.findByOldId(userId));
return userInfoDTO;
}
@Override
public Map<String, Object> login(LoginDTO dto) {
UserEntity user = getByMobile(dto.getMobile()); UserEntity user = getByMobile(dto.getMobile());
AssertUtils.isNull(user, ErrorCode.ACCOUNT_PASSWORD_ERROR); AssertUtils.isNull(user, ErrorCode.ACCOUNT_PASSWORD_ERROR);
...@@ -62,6 +83,29 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -62,6 +83,29 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return map; return map;
} }
/**
* 用户登录
*
* @param openId 免登
* @return 返回登录信息
*/
@Override
public Map<String, Object> login(String openId) {
UserEntity user = getByOpenId(openId);
AssertUtils.isNull(user, ErrorCode.WECHAT_OPENID_NOT_REGISTER);
//获取登录token
TokenEntity tokenEntity = tokenService.createToken(user.getId());
Map<String, Object> map = new HashMap<>(2);
map.put("token", tokenEntity.getToken());
map.put("expire", tokenEntity.getExpireDate().getTime() - System.currentTimeMillis());
List<UserRoleInfoDTO> roles = userDao.getUserRoleInfo(user.getId());
map.put("roles", roles);
return map;
}
@Override @Override
public PageData<UserEntity> getOrganizationAllUsers(Map<String, Object> params, Long userId) { public PageData<UserEntity> getOrganizationAllUsers(Map<String, Object> params, Long userId) {
IPage<UserEntity> page = getPage(params, Constant.CREATE_DATE, false); IPage<UserEntity> page = getPage(params, Constant.CREATE_DATE, false);
...@@ -75,4 +119,14 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -75,4 +119,14 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
return getPageData(list, page.getTotal(), UserEntity.class); return getPageData(list, page.getTotal(), UserEntity.class);
} }
@Override
public OrgUserInfoDTO getOrgUserByUserId(Long userId) {
return userDao.getOrgUserByUserId(userId);
}
@Override
public ServiceUserInfoDTO getServiceUserByUserId(Long userId) {
return userDao.getServiceUserByUserId(userId);
}
} }
\ No newline at end of file
...@@ -38,11 +38,11 @@ spring: ...@@ -38,11 +38,11 @@ spring:
max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接 max-idle: 10 # 连接池中的最大空闲连接
min-idle: 5 # 连接池中的最小空闲连接 min-idle: 5 # 连接池中的最小空闲连接
mvc: # mvc:
static-path-pattern: /static/** # static-path-pattern: /static/**
resources: # resources:
static-locations: file:${QR.download-path},classpath:/META-INF/resources/, classpath:/resources/, classpath:/static/, classpath:/public/ # static-locations: file:${QR.download-path},classpath:/META-INF/resources/, classpath:/resources/, classpath:/static/, classpath:/public/
#静态资源对外暴露的访问路径 # #静态资源对外暴露的访问路径
hmit: hmit:
redis: redis:
...@@ -75,6 +75,6 @@ QR: ...@@ -75,6 +75,6 @@ QR:
download-path: /home/websoft/java_jar/pension_service/myfile/ download-path: /home/websoft/java_jar/pension_service/myfile/
wechat: wechat:
mpAppId: wxfa2386639794d998 mpAppId: wx6e3288074243a47f
mpAppSecret: 8f624f83c9585baa9d1697e24fdffd81 mpAppSecret: 603d6ebf4db906bdb24eb9a1c0cbb444
templateId: GsGydVGl-vzOv5aA0LaIdA-FcMM88TEpe37U-lZ6HJ8 templateId: _7PQQku6jHU4yE42NZIbX9cyvRWeeMSAGKhhs0uzWYM
\ No newline at end of file \ No newline at end of file
...@@ -11,9 +11,32 @@ ...@@ -11,9 +11,32 @@
select * from tb_user where id = #{value} select * from tb_user where id = #{value}
</select> </select>
<select id="getUserByOpenId" resultType="io.hmit.entity.UserEntity">
select * from tb_user where openid = #{value}
</select>
<select id="getAllOrganizationStaff" resultType="Long"> <select id="getAllOrganizationStaff" resultType="Long">
SELECT user_id FROM pension_organization_user SELECT user_id FROM pension_organization_user
WHERE organization_id = (SELECT organization_id FROM pension_organization_user WHERE organization_id = (SELECT organization_id FROM pension_organization_user
WHERE user_id = #{userId}); WHERE user_id = #{userId});
</select> </select>
<select id="getOrgUserByUserId" resultType="io.hmit.dto.OrgUserInfoDTO">
SELECT tu.id, tu.username, tu.mobile, po.name, po.icon, po.description, po.service_area
FROM tb_user tu, pension_organization_user pou, pension_organization po
WHERE tu.id = pou.user_id AND po.id = pou.organization_id AND tu.id = #{userId};
</select>
<select id="getServiceUserByUserId" resultType="io.hmit.dto.ServiceUserInfoDTO">
SELECT tu.id, tu.username, tu.mobile, tu.gender, tu.address_area, tu.address, tu.birthday,
po.id AS orgId, po.name AS orgName, po.service_area
FROM tb_user tu, pension_organization_user pou, pension_organization po
WHERE tu.id = pou.user_id AND po.id = pou.organization_id AND tu.id = #{userId};
</select>
<select id="getUserRoleInfo" resultType="io.hmit.modules.serviceOrder.dto.UserRoleInfoDTO">
SELECT tr.id AS roleId, tr.name AS roleName FROM tb_role tr, tb_role_user tru
WHERE tru.role_id = tr.id AND tru.user_id = #{userId};
</select>
</mapper> </mapper>
\ No newline at end of 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="io.hmit.modules.serviceOrder.dao.PensionOldFamilyDao">
<resultMap type="io.hmit.modules.serviceOrder.entity.PensionOldFamilyEntity" id="pensionOldFamilyMap">
<result property="id" column="id"/>
<result property="oldId" column="old_id"/>
<result property="parentRole" column="parent_role"/>
<result property="familyMemberId" column="family_member_id"/>
<result property="familyMemberRole" column="family_member_role"/>
<result property="remark" column="remark"/>
<result property="creator" column="creator"/>
<result property="createDate" column="create_date"/>
<result property="updater" column="updater"/>
<result property="updateDate" column="update_date"/>
</resultMap>
<select id="findByOldId" resultType="io.hmit.modules.serviceOrder.dto.PensionOldFamilyDTO">
SELECT * FROM pension_old_family pof, tb_user tu
WHERE pof.family_member_id = tu.id and pof.old_id = #{oldId}
</select>
</mapper>
\ No newline at end of file
...@@ -62,4 +62,5 @@ public interface ErrorCode { ...@@ -62,4 +62,5 @@ public interface ErrorCode {
int END_PROCESS_MESSAGE = 10045; int END_PROCESS_MESSAGE = 10045;
int BACK_PROCESS_PARALLEL_ERROR = 10046; int BACK_PROCESS_PARALLEL_ERROR = 10046;
int BACK_PROCESS_HANDLEING_ERROR = 10047; int BACK_PROCESS_HANDLEING_ERROR = 10047;
int WECHAT_OPENID_NOT_REGISTER = 10048;
} }
...@@ -48,4 +48,5 @@ ...@@ -48,4 +48,5 @@
10045=终止 10045=终止
10046=多实例任务不能回退 10046=多实例任务不能回退
10047=存在多个并行执行的任务,不能回退 10047=存在多个并行执行的任务,不能回退
10044=存在多个处理中的任务,不能终止流程 10044=存在多个处理中的任务,不能终止流程
\ No newline at end of file 10048=微信号未注册
\ No newline at end of file
...@@ -48,4 +48,5 @@ ...@@ -48,4 +48,5 @@
10045=END 10045=END
10046=Multi-instance tasks cannot be rolled back 10046=Multi-instance tasks cannot be rolled back
10047=There are multiple parallel tasks that cannot be rolled back 10047=There are multiple parallel tasks that cannot be rolled back
10044=There are tasks in multiple processes that cannot terminate the process 10044=There are tasks in multiple processes that cannot terminate the process
\ No newline at end of file 10048=WeChat not registered
\ No newline at end of file
...@@ -48,4 +48,5 @@ ...@@ -48,4 +48,5 @@
10045=终止 10045=终止
10046=多实例任务不能回退 10046=多实例任务不能回退
10047=存在多个并行执行的任务,不能回退 10047=存在多个并行执行的任务,不能回退
10044=存在多个处理中的任务,不能终止流程 10044=存在多个处理中的任务,不能终止流程
\ No newline at end of file 10048=微信号未注册
\ No newline at end of file
...@@ -48,4 +48,5 @@ ...@@ -48,4 +48,5 @@
10045=終止 10045=終止
10046=多實例任務不能回退 10046=多實例任務不能回退
10047=存在多個並行執行的任務,不能回退 10047=存在多個並行執行的任務,不能回退
10044=存在多個處理中的任務,不能終止流程 10044=存在多個處理中的任務,不能終止流程
\ No newline at end of file 10048=微信号未注册
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment