Commit d4799cea authored by Shen's avatar Shen

1. 部分接口添加推送功能

parent 8422f765
...@@ -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注解的类,才生成接口文档
......
...@@ -16,6 +16,7 @@ import io.hmit.modules.serviceOrder.dto.PensionOrderDTO; ...@@ -16,6 +16,7 @@ import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.dto.ReservationDTO; import io.hmit.modules.serviceOrder.dto.ReservationDTO;
import io.hmit.modules.serviceOrder.dto.StaffFinishDTO; import io.hmit.modules.serviceOrder.dto.StaffFinishDTO;
import io.hmit.modules.serviceOrder.service.*; import io.hmit.modules.serviceOrder.service.*;
import io.hmit.service.PushMessage;
import io.hmit.service.UserService; 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;
...@@ -54,6 +55,9 @@ public class PensionOrderController { ...@@ -54,6 +55,9 @@ public class PensionOrderController {
@Autowired @Autowired
private PensionServiceService pensionServiceService; private PensionServiceService pensionServiceService;
@Autowired
private PushMessage pushMessage;
@Login @Login
@GetMapping("page") @GetMapping("page")
@ApiOperation("全部订单(志愿者)") @ApiOperation("全部订单(志愿者)")
...@@ -190,6 +194,7 @@ public class PensionOrderController { ...@@ -190,6 +194,7 @@ public class PensionOrderController {
pensionOrderDTO.setStatus(Constant.OrderStatus.ORDER.geStatus()); pensionOrderDTO.setStatus(Constant.OrderStatus.ORDER.geStatus());
pensionOrderDTO.setStatusName("已接单"); pensionOrderDTO.setStatusName("已接单");
pensionOrderService.update(pensionOrderDTO); pensionOrderService.update(pensionOrderDTO);
pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid());
return new Result(); return new Result();
} }
......
...@@ -235,6 +235,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -235,6 +235,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
pensionOrderEntity.setContent(dto.getContent()); pensionOrderEntity.setContent(dto.getContent());
pensionOrderEntity.setLocation(dto.getLocation()); pensionOrderEntity.setLocation(dto.getLocation());
update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class)); update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class));
pushMessage.sendWeChatMsg(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class), userService.getUserByUserId(pensionOrderEntity.getCreator()).getOpenid());
} }
//对List进行手动分页 //对List进行手动分页
...@@ -300,6 +301,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -300,6 +301,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
} }
update(pensionOrderDTO); update(pensionOrderDTO);
// saveFilesToDB(dto.getOrderId(),dto.getFiles(),dto.getRoleId()); // saveFilesToDB(dto.getOrderId(),dto.getFiles(),dto.getRoleId());
pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid());
} }
} }
...@@ -54,7 +54,7 @@ public class PushMessageImpl implements PushMessage { ...@@ -54,7 +54,7 @@ public class PushMessageImpl implements PushMessage {
new WxMpTemplateData("keyword2", pensionOrderDTO.getId().toString()), new WxMpTemplateData("keyword2", pensionOrderDTO.getId().toString()),
new WxMpTemplateData("keyword3", pensionOrderDTO.getServiceName()), new WxMpTemplateData("keyword3", pensionOrderDTO.getServiceName()),
new WxMpTemplateData("keyword4", appointmentTime), new WxMpTemplateData("keyword4", appointmentTime),
new WxMpTemplateData("remark", "备注:" + pensionOrderDTO.getRemark()) new WxMpTemplateData("remark", "当前状态:" + pensionOrderDTO.getStatusName())
); );
templateMessage.setData(data); templateMessage.setData(data);
try{ try{
......
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