Commit a1990569 authored by Shen's avatar Shen

1. 添加活动状态枚举类

2. 优化静态资源访问
3. 用户注册身份证信息非必填
4. 添加服务根据前端返回机构id添加绑定机构
parent 0df4f6ae
...@@ -33,7 +33,7 @@ public class SwaggerConfig { ...@@ -33,7 +33,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注解的类,生成接口文档
......
...@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; ...@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.hmit.common.utils.DateUtils; import io.hmit.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.ByteArrayHttpMessageConverter; import org.springframework.http.converter.ByteArrayHttpMessageConverter;
...@@ -24,11 +25,13 @@ import java.util.TimeZone; ...@@ -24,11 +25,13 @@ import java.util.TimeZone;
@Configuration @Configuration
public class WebMvcConfig implements WebMvcConfigurer { public class WebMvcConfig implements WebMvcConfigurer {
@Value("${QR.download-path}")
private String QRPath;
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/swagger2/**").addResourceLocations("classpath:/swagger2/"); registry.addResourceHandler("/swagger2/**").addResourceLocations("classpath:/swagger2/");
registry.addResourceHandler("/static/**").addResourceLocations("file:/home/websoft/java_jar/pension_service/myfile/"); registry.addResourceHandler("/static/**").addResourceLocations("file:" + QRPath);
// registry.addResourceHandler("/static/**").addResourceLocations("file:D:/upload/pension/");
} }
@Override @Override
......
...@@ -10,9 +10,12 @@ import io.hmit.common.validator.ValidatorUtils; ...@@ -10,9 +10,12 @@ import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup; import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup; import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup; import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.security.user.SecurityUser;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationServiceDTO;
import io.hmit.modules.serviceOrder.dto.PensionServiceDTO; import io.hmit.modules.serviceOrder.dto.PensionServiceDTO;
import io.hmit.modules.serviceOrder.dto.PensionServiceDocumentDTO; import io.hmit.modules.serviceOrder.dto.PensionServiceDocumentDTO;
import io.hmit.modules.serviceOrder.excel.PensionServiceExcel; import io.hmit.modules.serviceOrder.excel.PensionServiceExcel;
import io.hmit.modules.serviceOrder.service.PensionOrganizationServiceService;
import io.hmit.modules.serviceOrder.service.PensionServiceDocumentService; import io.hmit.modules.serviceOrder.service.PensionServiceDocumentService;
import io.hmit.modules.serviceOrder.service.PensionServiceService; import io.hmit.modules.serviceOrder.service.PensionServiceService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -45,6 +48,9 @@ public class PensionServiceController { ...@@ -45,6 +48,9 @@ public class PensionServiceController {
@Autowired @Autowired
private PensionServiceDocumentService pensionServiceDocumentService; private PensionServiceDocumentService pensionServiceDocumentService;
@Autowired
private PensionOrganizationServiceService pensionOrganizationServiceService;
@GetMapping("page") @GetMapping("page")
@ApiOperation("分页") @ApiOperation("分页")
@ApiImplicitParams({ @ApiImplicitParams({
...@@ -107,6 +113,12 @@ public class PensionServiceController { ...@@ -107,6 +113,12 @@ public class PensionServiceController {
pensionServiceService.save(dto); pensionServiceService.save(dto);
PensionOrganizationServiceDTO pensionOrganizationServiceDTO = new PensionOrganizationServiceDTO();
pensionOrganizationServiceDTO.setServiceId(dto.getId());
pensionOrganizationServiceDTO.setOrganizationId(dto.getServiceOrgId());
pensionOrganizationServiceDTO.setCreator(SecurityUser.getUserId());
pensionOrganizationServiceService.save(pensionOrganizationServiceDTO);
//保存服务详情页面的轮播图 //保存服务详情页面的轮播图
List<PensionServiceDocumentDTO> pensionServiceDocumentDTOList = dto.getPensionServiceDocumentDTOList(); List<PensionServiceDocumentDTO> pensionServiceDocumentDTOList = dto.getPensionServiceDocumentDTOList();
if(pensionServiceDocumentDTOList!=null){ if(pensionServiceDocumentDTOList!=null){
......
...@@ -36,6 +36,9 @@ public class PensionServiceDTO extends TreeNode<PensionServiceDTO> implements Se ...@@ -36,6 +36,9 @@ public class PensionServiceDTO extends TreeNode<PensionServiceDTO> implements Se
@ApiModelProperty(value = "服务父类id") @ApiModelProperty(value = "服务父类id")
private Long pid; private Long pid;
@ApiModelProperty(value = "服务机构")
private Long serviceOrgId;
@ApiModelProperty(value = "排序") @ApiModelProperty(value = "排序")
private Integer sort; private Integer sort;
......
...@@ -72,6 +72,7 @@ mybatis-plus: ...@@ -72,6 +72,7 @@ mybatis-plus:
call-setters-on-nulls: true call-setters-on-nulls: true
jdbc-type-for-null: 'null' jdbc-type-for-null: 'null'
QR: QR:
# download-path: D:/upload/pension/ download-path: D:/upload/pension/
# download-path: /home/websoft/java_jar/pension_service/myfile/
# download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/pension_service/myfile/ # download-path: /home/resourse/bsqzc/ D:/123/ /home/websoft/java_jar/pension_service/myfile/
download-path: /home/websoft/java_jar/pension_service/myfile/ #此处修改需要在io.hmit.modules.security.config.WebMvcConfig 修改静态资源位置
\ No newline at end of file
...@@ -8,6 +8,7 @@ import io.hmit.common.utils.DateUtils; ...@@ -8,6 +8,7 @@ import io.hmit.common.utils.DateUtils;
import io.hmit.interceptor.AuthorizationInterceptor; import io.hmit.interceptor.AuthorizationInterceptor;
import io.hmit.resolver.LoginUserHandlerMethodArgumentResolver; import io.hmit.resolver.LoginUserHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.ByteArrayHttpMessageConverter; import org.springframework.http.converter.ByteArrayHttpMessageConverter;
...@@ -33,11 +34,13 @@ import java.util.TimeZone; ...@@ -33,11 +34,13 @@ import java.util.TimeZone;
@Configuration @Configuration
public class WebMvcConfig implements WebMvcConfigurer { public class WebMvcConfig implements WebMvcConfigurer {
@Value("${QR.download-path}")
private String QRPath;
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/swagger2/**").addResourceLocations("classpath:/swagger2/"); registry.addResourceHandler("/swagger2/**").addResourceLocations("classpath:/swagger2/");
registry.addResourceHandler("/static/**").addResourceLocations("file:/home/websoft/java_jar/pension_service/myfile/"); registry.addResourceHandler("/static/**").addResourceLocations("file:" + QRPath);
// registry.addResourceHandler("/static/**").addResourceLocations("file:D:/123/");
} }
@Autowired @Autowired
......
...@@ -388,12 +388,14 @@ public class PensionOrderController { ...@@ -388,12 +388,14 @@ public class PensionOrderController {
*/ */
@Login @Login
@GetMapping("organizationHandle") @GetMapping("organizationHandle")
@ApiOperation(value = "机构处理(机构)", notes = "传参为1(派单)时,recipient_id必传;传参为3(取消)时,cancel_reason必传;") @ApiOperation(value = "机构处理(机构)", notes = "传参为1(派单)时,需要recipient_id和appointment_time;传参为3(取消)时,cancel_reason必传;")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "订单ID", paramType = "query", required = true, dataType="long") , @ApiImplicitParam(name = "id", value = "订单ID", paramType = "query", required = true, dataType="long") ,
@ApiImplicitParam(name = "status", value = "处理状态: 5接单 1派单 3取消", paramType = "query", required = true, dataType="int") , @ApiImplicitParam(name = "status", value = "处理状态: 5接单 1派单 3取消 4机构完成", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = "recipient_id", value = "接单服务人员ID", paramType = "query", dataType="long") , @ApiImplicitParam(name = "recipientId", value = "接单服务人员ID", paramType = "query", dataType="long") ,
@ApiImplicitParam(name = "cancel_reason", value = "订单取消原因", paramType = "query", dataType="String") @ApiImplicitParam(name = "appointmentTime", value = "预约时间", paramType = "query", dataType="Date") ,
@ApiImplicitParam(name = "cancelReason", value = "订单取消原因", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "remark", value = "备注", paramType = "query", defaultValue = "null", dataType="String")
}) })
public Result organizationHandle(@ApiIgnore @LoginUser UserEntity user, public Result organizationHandle(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){ @ApiIgnore @RequestParam Map<String, Object> params){
......
...@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -176,17 +177,22 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -176,17 +177,22 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
//userId 可用于校验是否属于本机构的订单,暂未使用 //userId 可用于校验是否属于本机构的订单,暂未使用
Long orderId = Long.parseLong(params.get("id").toString()); Long orderId = Long.parseLong(params.get("id").toString());
PensionOrderEntity pensionOrderEntity = pensionOrderDao.selectById(orderId); PensionOrderEntity pensionOrderEntity = pensionOrderDao.selectById(orderId);
Integer status = Integer.parseInt(params.get("status").toString()); pensionOrderEntity.setRemark(null != params.get("remark") ? params.get("remark").toString() : "");
int status = Integer.parseInt(params.get("status").toString());
if (status == 5) { //接单 if (status == 5) { //接单
if (pensionOrderEntity.getStatus() == 0) { if (pensionOrderEntity.getStatus() == 0) {
pensionOrderEntity.setStatus(5); pensionOrderEntity.setStatus(5);
pensionOrderEntity.setStatusName(Constant.OrderStatus.HAND_OUT.getMessage()); pensionOrderEntity.setStatusName(Constant.OrderStatus.HAND_OUT.getMessage());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
pensionOrderEntity.setAppointmentTime(sdf.parse(params.get("appointmentTime").toString()));
}catch (Exception ignored){}
update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class)); update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class));
}else { }else {
return false; return false;
} }
}else if (status == 1){ //派单 }else if (status == 1){ //派单
Long recipient_id = Long.parseLong(params.get("recipient_id").toString()); Long recipient_id = Long.parseLong(params.get("recipientId").toString());
if (pensionOrderEntity.getStatus() == 5 || pensionOrderEntity.getStatus() == 0) { if (pensionOrderEntity.getStatus() == 5 || pensionOrderEntity.getStatus() == 0) {
pensionOrderEntity.setStatus(1); pensionOrderEntity.setStatus(1);
pensionOrderEntity.setStatusName(Constant.OrderStatus.ORDER.getMessage()); pensionOrderEntity.setStatusName(Constant.OrderStatus.ORDER.getMessage());
...@@ -203,11 +209,17 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -203,11 +209,17 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
if (pensionOrderEntity.getStatus() != 2 && pensionOrderEntity.getStatus() != 4) { if (pensionOrderEntity.getStatus() != 2 && pensionOrderEntity.getStatus() != 4) {
pensionOrderEntity.setStatus(3); pensionOrderEntity.setStatus(3);
pensionOrderEntity.setStatusName(Constant.OrderStatus.CANCEL.getMessage()); pensionOrderEntity.setStatusName(Constant.OrderStatus.CANCEL.getMessage());
pensionOrderEntity.setCancelReason(params.get("cancel_reason").toString()); pensionOrderEntity.setCancelReason(params.get("cancelReason").toString());
update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class)); update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class));
} else { } else {
return false; return false;
} }
}else if (status == 4) {
if (pensionOrderEntity.getStatus() == Constant.OrderStatus.ORDER.geStatus()) {
pensionOrderEntity.setStatus(Constant.OrderStatus.WAIT_EVALUATE.geStatus());
pensionOrderEntity.setStatusName(Constant.OrderStatus.WAIT_EVALUATE.getMessage());
update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class));
}
} }
return true; return true;
} }
......
...@@ -157,7 +157,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -157,7 +157,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
userEntity = new UserEntity(); userEntity = new UserEntity();
userEntity.setUsername(dto.getUsername()); userEntity.setUsername(dto.getUsername());
userEntity.setMobile(dto.getMobile()); userEntity.setMobile(dto.getMobile());
userEntity.setPassword(DigestUtils.sha256Hex(dto.getIdCardNo().toString())); if (null != userEntity.getPassword()) {
userEntity.setPassword(DigestUtils.sha256Hex(dto.getIdCardNo().toString()));
}
userEntity.setAddress(dto.getAddress()); userEntity.setAddress(dto.getAddress());
userEntity.setAddressArea(dto.getAddressArea()); userEntity.setAddressArea(dto.getAddressArea());
userEntity.setCommunityId(dto.getCommunityId()); userEntity.setCommunityId(dto.getCommunityId());
...@@ -165,19 +167,21 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem ...@@ -165,19 +167,21 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
userEntity.setIdCardNo(dto.getIdCardNo()); userEntity.setIdCardNo(dto.getIdCardNo());
userEntity.setCommunityName(dto.getCommunityName()); userEntity.setCommunityName(dto.getCommunityName());
userEntity.setHealthStatus("良好"); //TODO userEntity.setHealthStatus("良好"); //TODO
String year = dto.getIdCardNo().toString().substring(6, 10); if (null != dto.getIdCardNo()) {
String month = dto.getIdCardNo().toString().substring(10, 12); String year = dto.getIdCardNo().toString().substring(6, 10);
String day = dto.getIdCardNo().toString().substring(12, 14); String month = dto.getIdCardNo().toString().substring(10, 12);
String time = year+"-"+month+"-"+day; String day = dto.getIdCardNo().toString().substring(12, 14);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String time = year+"-"+month+"-"+day;
Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try { Date date = new Date();
date = sdf.parse(time); try {
} catch (ParseException e) { date = sdf.parse(time);
e.printStackTrace(); } catch (ParseException e) {
e.printStackTrace();
}
userEntity.setBirthday(date);
userEntity.setGender(Integer.parseInt(dto.getIdCardNo().toString().substring(16, 17)) % 2 == 1 ? "男" : "女");
} }
userEntity.setBirthday(date);
userEntity.setGender(Integer.parseInt(dto.getIdCardNo().toString().substring(16, 17)) % 2 == 1 ? "男" : "女");
userEntity.setOpenid(dto.getOpenid()); userEntity.setOpenid(dto.getOpenid());
insert(userEntity); insert(userEntity);
UserEntity byOpenId = getByOpenId(dto.getOpenid()); UserEntity byOpenId = getByOpenId(dto.getOpenid());
......
...@@ -77,5 +77,6 @@ QR: ...@@ -77,5 +77,6 @@ QR:
wechat: wechat:
mpAppId: wx6e3288074243a47f mpAppId: wx6e3288074243a47f
mpAppSecret: 603d6ebf4db906bdb24eb9a1c0cbb444 mpAppSecret: f7b1120a49de078dd1be0080832ad42f
# mpAppSecret: 603d6ebf4db906bdb24eb9a1c0cbb444
templateId: _7PQQku6jHU4yE42NZIbX9cyvRWeeMSAGKhhs0uzWYM templateId: _7PQQku6jHU4yE42NZIbX9cyvRWeeMSAGKhhs0uzWYM
\ No newline at end of file
package io.hmit.common.enums;
import lombok.Getter;
/**
* @Description : 活动状态枚举类
* @Author : Shen Yuanfeng
* @Date : 2021/5/12 15:35
*/
@Getter
public enum EventEnum {
NEW(0,"未发布(草稿)"),
SUCCESS(1,"已发布(可报名)"),
CANCEL(2,"结束报名"),
COMPLETE(3,"活动结束"),
SIGNED(4,"隐藏"),
;
private Integer code;
private String msg;
EventEnum(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
}
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