Commit a1990569 authored by Shen's avatar Shen

1. 添加活动状态枚举类

2. 优化静态资源访问
3. 用户注册身份证信息非必填
4. 添加服务根据前端返回机构id添加绑定机构
parent 0df4f6ae
......@@ -33,7 +33,7 @@ public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
// .host("byyl.zjhmit.com")
.host("byyl.zjhmit.com")
.apiInfo(apiInfo())
.select()
//加了ApiOperation注解的类,生成接口文档
......
......@@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.hmit.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
......@@ -24,11 +25,13 @@ import java.util.TimeZone;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Value("${QR.download-path}")
private String QRPath;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/swagger2/**").addResourceLocations("classpath:/swagger2/");
registry.addResourceHandler("/static/**").addResourceLocations("file:/home/websoft/java_jar/pension_service/myfile/");
// registry.addResourceHandler("/static/**").addResourceLocations("file:D:/upload/pension/");
registry.addResourceHandler("/static/**").addResourceLocations("file:" + QRPath);
}
@Override
......
......@@ -10,9 +10,12 @@ 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.security.user.SecurityUser;
import io.hmit.modules.serviceOrder.dto.PensionOrganizationServiceDTO;
import io.hmit.modules.serviceOrder.dto.PensionServiceDTO;
import io.hmit.modules.serviceOrder.dto.PensionServiceDocumentDTO;
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.PensionServiceService;
import io.swagger.annotations.Api;
......@@ -45,6 +48,9 @@ public class PensionServiceController {
@Autowired
private PensionServiceDocumentService pensionServiceDocumentService;
@Autowired
private PensionOrganizationServiceService pensionOrganizationServiceService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
......@@ -107,6 +113,12 @@ public class PensionServiceController {
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();
if(pensionServiceDocumentDTOList!=null){
......
......@@ -36,6 +36,9 @@ public class PensionServiceDTO extends TreeNode<PensionServiceDTO> implements Se
@ApiModelProperty(value = "服务父类id")
private Long pid;
@ApiModelProperty(value = "服务机构")
private Long serviceOrgId;
@ApiModelProperty(value = "排序")
private Integer sort;
......
......@@ -72,6 +72,7 @@ mybatis-plus:
call-setters-on-nulls: true
jdbc-type-for-null: 'null'
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/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;
import io.hmit.interceptor.AuthorizationInterceptor;
import io.hmit.resolver.LoginUserHandlerMethodArgumentResolver;
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.Configuration;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
......@@ -33,11 +34,13 @@ import java.util.TimeZone;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
@Value("${QR.download-path}")
private String QRPath;
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/swagger2/**").addResourceLocations("classpath:/swagger2/");
registry.addResourceHandler("/static/**").addResourceLocations("file:/home/websoft/java_jar/pension_service/myfile/");
// registry.addResourceHandler("/static/**").addResourceLocations("file:D:/123/");
registry.addResourceHandler("/static/**").addResourceLocations("file:" + QRPath);
}
@Autowired
......
......@@ -388,12 +388,14 @@ public class PensionOrderController {
*/
@Login
@GetMapping("organizationHandle")
@ApiOperation(value = "机构处理(机构)", notes = "传参为1(派单)时,recipient_id必传;传参为3(取消)时,cancel_reason必传;")
@ApiOperation(value = "机构处理(机构)", notes = "传参为1(派单)时,需要recipient_id和appointment_time;传参为3(取消)时,cancel_reason必传;")
@ApiImplicitParams({
@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 = "recipient_id", value = "接单服务人员ID", paramType = "query", dataType="long") ,
@ApiImplicitParam(name = "cancel_reason", value = "订单取消原因", paramType = "query", dataType="String")
@ApiImplicitParam(name = "status", value = "处理状态: 5接单 1派单 3取消 4机构完成", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = "recipientId", value = "接单服务人员ID", paramType = "query", dataType="long") ,
@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,
@ApiIgnore @RequestParam Map<String, Object> params){
......
......@@ -18,6 +18,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -176,17 +177,22 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
//userId 可用于校验是否属于本机构的订单,暂未使用
Long orderId = Long.parseLong(params.get("id").toString());
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 (pensionOrderEntity.getStatus() == 0) {
pensionOrderEntity.setStatus(5);
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));
}else {
return false;
}
}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) {
pensionOrderEntity.setStatus(1);
pensionOrderEntity.setStatusName(Constant.OrderStatus.ORDER.getMessage());
......@@ -203,11 +209,17 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
if (pensionOrderEntity.getStatus() != 2 && pensionOrderEntity.getStatus() != 4) {
pensionOrderEntity.setStatus(3);
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));
} else {
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;
}
......
......@@ -157,7 +157,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
userEntity = new UserEntity();
userEntity.setUsername(dto.getUsername());
userEntity.setMobile(dto.getMobile());
if (null != userEntity.getPassword()) {
userEntity.setPassword(DigestUtils.sha256Hex(dto.getIdCardNo().toString()));
}
userEntity.setAddress(dto.getAddress());
userEntity.setAddressArea(dto.getAddressArea());
userEntity.setCommunityId(dto.getCommunityId());
......@@ -165,6 +167,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
userEntity.setIdCardNo(dto.getIdCardNo());
userEntity.setCommunityName(dto.getCommunityName());
userEntity.setHealthStatus("良好"); //TODO
if (null != dto.getIdCardNo()) {
String year = dto.getIdCardNo().toString().substring(6, 10);
String month = dto.getIdCardNo().toString().substring(10, 12);
String day = dto.getIdCardNo().toString().substring(12, 14);
......@@ -178,6 +181,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
}
userEntity.setBirthday(date);
userEntity.setGender(Integer.parseInt(dto.getIdCardNo().toString().substring(16, 17)) % 2 == 1 ? "男" : "女");
}
userEntity.setOpenid(dto.getOpenid());
insert(userEntity);
UserEntity byOpenId = getByOpenId(dto.getOpenid());
......
......@@ -77,5 +77,6 @@ QR:
wechat:
mpAppId: wx6e3288074243a47f
mpAppSecret: 603d6ebf4db906bdb24eb9a1c0cbb444
mpAppSecret: f7b1120a49de078dd1be0080832ad42f
# mpAppSecret: 603d6ebf4db906bdb24eb9a1c0cbb444
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