Commit d4799cea authored by Shen's avatar Shen

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

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