Commit 80127ce8 authored by Shen's avatar Shen

1. 更新微信推送模板id

2. 更新枚举类字段
3. 添加更新活动状态接口
4. 修复移动端机构人员信息
parent 2723f560
......@@ -81,6 +81,20 @@ public class PensionEventController {
return new Result<PensionEventDTO>().ok(data);
}
@PostMapping("updateStatus")
@ApiOperation("更新活动状态")
@LogOperation("更新活动状态")
@RequiresPermissions("serviceOrder:pensionevent:save")
public Result updateStatus(@RequestParam("eventId") Long id,
@RequestParam("status") Integer status,
@RequestParam(value = "endDesc", required = false) String endDesc,
@RequestParam(value = "eventClock", required = false) String eventClock) {
pensionEventService.updateStatus(id, status, endDesc, eventClock);
return new Result();
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
......
......@@ -12,4 +12,6 @@ import io.hmit.modules.serviceOrder.entity.PensionEventEntity;
*/
public interface PensionEventService extends CrudService<PensionEventEntity, PensionEventDTO> {
PensionEventDTO updateStatus(Long id, Integer status, String endDesc, String eventClock);
}
\ 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.enums.EventEnum;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.modules.serviceOrder.dao.PensionEventDao;
import io.hmit.modules.serviceOrder.dto.PensionEventDTO;
import io.hmit.modules.serviceOrder.entity.PensionEventEntity;
......@@ -31,4 +33,29 @@ public class PensionEventServiceImpl extends CrudServiceImpl<PensionEventDao, Pe
}
@Override
public PensionEventDTO updateStatus(Long id, Integer status, String endDesc, String eventClock) {
PensionEventEntity pensionEventEntity = selectById(id);
if (status.equals(EventEnum.SUCCESS.getCode())) { //开始报名 / 发布
if (pensionEventEntity.getStatus().equals(EventEnum.NEW.getCode())){
pensionEventEntity.setStatus(EventEnum.SUCCESS.getCode());
}
}else if (status.equals(EventEnum.OVER.getCode())) { //停止报名
if (pensionEventEntity.getStatus().equals(EventEnum.NEW.getCode())){
pensionEventEntity.setStatus(EventEnum.OVER.getCode());
}
}else if (status.equals(EventEnum.COMPLETE.getCode())) { //活动结束
if (pensionEventEntity.getStatus().equals(EventEnum.OVER.getCode())){
pensionEventEntity.setStatus(EventEnum.COMPLETE.getCode());
pensionEventEntity.setEventClock(eventClock);
pensionEventEntity.setEventEndDescribe(endDesc);
}
}else if (status.equals(EventEnum.HIDDEN.getCode())){ //活动隐藏
if (pensionEventEntity.getStatus().equals(EventEnum.COMPLETE.getCode())){
pensionEventEntity.setStatus(EventEnum.HIDDEN.getCode());
}
}
update(ConvertUtils.sourceToTarget(pensionEventEntity, PensionEventDTO.class));
return null;
}
}
\ No newline at end of file
......@@ -194,7 +194,7 @@ public class PensionOrderController {
pensionOrderDTO.setStatus(Constant.OrderStatus.ORDER.geStatus());
pensionOrderDTO.setStatusName("已接单");
pensionOrderService.update(pensionOrderDTO);
pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid());
pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid(), "oldman");
return new Result();
}
......
......@@ -91,7 +91,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
save(pensionOrderDTO);
PensionOrderServiceDTO orderServiceDTO = new PensionOrderServiceDTO().assemblePensionOrderService(pensionOrderDTO);
pensionOrderServiceService.save(orderServiceDTO);
pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid());
pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid(), "oldman");
// pushMessage.sendSMSMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid());
}
......@@ -251,7 +251,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());
pushMessage.sendWeChatMsg(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class), userService.getUserByUserId(pensionOrderEntity.getCreator()).getOpenid(), "oldman");
}
//对List进行手动分页
......@@ -317,7 +317,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());
pushMessage.sendWeChatMsg(pensionOrderDTO, userService.getUserByUserId(pensionOrderDTO.getCreator()).getOpenid(), "oldman");
}
}
......@@ -4,7 +4,7 @@ import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
public interface PushMessage {
void sendWeChatMsg(PensionOrderDTO pensionOrderDTO, String openId);
void sendWeChatMsg(PensionOrderDTO pensionOrderDTO, String openId, String flag);
void sendSMSMsg(PensionOrderDTO pensionOrderDTO, String receiver);
......
......@@ -44,7 +44,7 @@ public class PushMessageImpl implements PushMessage {
private SmsService smsService;
@Override
public void sendWeChatMsg(PensionOrderDTO pensionOrderDTO, String openId) {
public void sendWeChatMsg(PensionOrderDTO pensionOrderDTO, String openId, String flag) {
WxMpTemplateMessage templateMessage = new WxMpTemplateMessage();
templateMessage.setTemplateId(wechatAccountConfig.getTemplateId());
templateMessage.setToUser(openId);
......@@ -54,14 +54,14 @@ public class PushMessageImpl implements PushMessage {
List<WxMpTemplateData> data = Arrays.asList(
new WxMpTemplateData("first", "【智慧养老】您的订单提醒"),
new WxMpTemplateData("keyword1", pensionOrderDTO.getServiceName()),
new WxMpTemplateData("keyword2", pensionOrderDTO.getId().toString()),
new WxMpTemplateData("keyword3", pensionOrderDTO.getServiceName()),
new WxMpTemplateData("keyword4", appointmentTime),
new WxMpTemplateData("keyword1", pensionOrderDTO.getId().toString()),
new WxMpTemplateData("keyword2", pensionOrderDTO.getServiceName()),
new WxMpTemplateData("keyword3", appointmentTime),
new WxMpTemplateData("remark", "当前状态:" + pensionOrderDTO.getStatusName())
);
templateMessage.setData(data);
templateMessage.setUrl(SYSURL + "/?openid=" + openId + "#/orderDetail?id=" + pensionOrderDTO.getId());
String url = SYSURL + "/#/orderDetail/?openid=" + openId + "&id=" + pensionOrderDTO.getId()+"&flag="+flag;
templateMessage.setUrl(url);
try{
wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage);
}catch (WxErrorException e){
......
......@@ -83,4 +83,4 @@ wechat:
# mpAppId: wx6e3288074243a47f
mpAppSecret: f7b1120a49de078dd1be0080832ad42f
# mpAppSecret: 603d6ebf4db906bdb24eb9a1c0cbb444
templateId: _7PQQku6jHU4yE42NZIbX9cyvRWeeMSAGKhhs0uzWYM
\ No newline at end of file
templateId: gU3gtQxrwX0Z6khAL_9tuwzT83KlXk3oV6jbPNuNHbc
\ No newline at end of file
......@@ -12,8 +12,9 @@
</resultMap>
<select id="findServiceIdListByServiceUserId" resultType="Long">
SELECT pos.service_id FROM pension_organization_user pou, pension_organization_service pos
WHERE pou.organization_id = pos.organization_id and pou.user_id = #{userId}
SELECT pos.service_id FROM pension_organization_service pos,
(SELECT pou.organization_id, tu.id FROM pension_organization_user pou, tb_user tu WHERE pou.user_id = tu.user_id) pou
WHERE pos.organization_id = pou.organization_id and pou.id = #{userId}
</select>
</mapper>
\ No newline at end of file
......@@ -12,9 +12,9 @@ import lombok.Getter;
public enum EventEnum {
NEW(0,"未发布(草稿)"),
SUCCESS(1,"已发布(可报名)"),
CANCEL(2,"结束报名"),
OVER(2,"结束报名"),
COMPLETE(3,"活动结束"),
SIGNED(4,"隐藏"),
HIDDEN(4,"隐藏"),
;
private Integer code;
......
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