| @@ -10,12 +10,10 @@ import com.iformall.service.WxBusinessService; | |||||
| import com.iformall.service.WxSubBusinessService; | import com.iformall.service.WxSubBusinessService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.collections.map.LinkedMap; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -13,7 +13,6 @@ import org.springframework.amqp.core.AmqpTemplate; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.context.annotation.Profile; | import org.springframework.context.annotation.Profile; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.util.UUID; | import java.util.UUID; | ||||
| /** | /** | ||||
| @@ -32,15 +31,16 @@ public class RabbitMqMessageProducer implements MqBaseProducer { | |||||
| @Autowired | @Autowired | ||||
| private WxMsgRecordService wxMsgRecordService; | private WxMsgRecordService wxMsgRecordService; | ||||
| @Override | @Override | ||||
| public void sendMessage(BaseMsg data, String topic, String tags, String keys) { | public void sendMessage(BaseMsg data, String topic, String tags, String keys) { | ||||
| try { | try { | ||||
| data.setUuid(UUID.randomUUID().toString()); | data.setUuid(UUID.randomUUID().toString()); | ||||
| wxMsgRecordService.save(data); | |||||
| rabbitTemplate.convertAndSend(topic, JsonUtil.obj2Json(data)); | rabbitTemplate.convertAndSend(topic, JsonUtil.obj2Json(data)); | ||||
| wxMsgRecordService.save(data); | |||||
| data.setMsgStatus(EnumMsgRecordStatus.SEND_SUCC.getCode()); | |||||
| wxMsgRecordMapper.update(data); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| log.error("RabbitMqMessageProducer: Send Message Error ", e); | log.error("RabbitMqMessageProducer: Send Message Error ", e); | ||||
| } | } | ||||
| @@ -138,7 +138,7 @@ public class WxFlowServiceImpl implements WxFlowService { | |||||
| if(supplement!=null && supplement && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | if(supplement!=null && supplement && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) { | ||||
| wxRentContractService.updateRentContractStatus(businessId); | wxRentContractService.updateRentContractStatus(businessId); | ||||
| } | } | ||||
| }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType) || EnumFlowContractType.PROPERTY_POINT.getCode().equals(contractType)){ | |||||
| }else if(EnumFlowContractType.PROPERTY.getCode().equals(contractType) || EnumFlowContractType.PROPERTY_POINT.getCode().equals(contractType)){ | |||||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | WxPropertyContract wxPropertyContract = new WxPropertyContract(); | ||||
| wxPropertyContract.setId(businessId); | wxPropertyContract.setId(businessId); | ||||
| wxPropertyContract.setApplyStatus(applyStatus); | wxPropertyContract.setApplyStatus(applyStatus); | ||||
| @@ -46,7 +46,7 @@ public class WxMsgRecordServiceImpl implements WxMsgRecordService { | |||||
| msgRecord.setUuid(data.getUuid()); | msgRecord.setUuid(data.getUuid()); | ||||
| msgRecord.setId(idWorker.nextId()); | msgRecord.setId(idWorker.nextId()); | ||||
| msgRecord.setMsgJson(JsonUtil.obj2Json(data)); | msgRecord.setMsgJson(JsonUtil.obj2Json(data)); | ||||
| msgRecord.setMsgStatus(EnumMsgRecordStatus.SEND_SUCC.getCode()); | |||||
| msgRecord.setMsgStatus(EnumMsgRecordStatus.DEFAULT.getCode()); | |||||
| wxMsgRecordMapper.save(msgRecord); | wxMsgRecordMapper.save(msgRecord); | ||||
| } | } | ||||
| @@ -63,9 +63,11 @@ | |||||
| update wx_msg_record set updatetime = now() | update wx_msg_record set updatetime = now() | ||||
| <if test=" null != msgStatus ">,msg_status = #{msgStatus}</if> | <if test=" null != msgStatus ">,msg_status = #{msgStatus}</if> | ||||
| <if test=" null != statusMessage ">,status_message = #{statusMessage}</if> | <if test=" null != statusMessage ">,status_message = #{statusMessage}</if> | ||||
| <where> | |||||
| <if test=" null != uuid ">and uuid = #{uuid}</if> | |||||
| </where> | |||||
| where id in( | |||||
| select t.id from ( | |||||
| select id from wx_msg_record where uuid = #{uuid} | |||||
| ) t | |||||
| ) | |||||
| </update> | </update> | ||||
| <select id="findList" parameterType="com.iformall.domain.po.msg.WxMsgRecord" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.msg.WxMsgRecord" resultMap="BaseResultMap"> | ||||
| @@ -87,15 +87,17 @@ | |||||
| </select> | </select> | ||||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxTopic"> | <update id="updateStatus" parameterType="com.iformall.domain.po.WxTopic"> | ||||
| update wx_topic set status = 3 where now() >= end_time and tenant_id = #{tenantId} | |||||
| update wx_topic set status = 3 where id in( | |||||
| select t.id from ( | |||||
| select id from wx_topic where status !=3 and now() >= end_time and tenant_id = #{tenantId} | |||||
| ) t | |||||
| ) | |||||
| </update> | </update> | ||||
| <update id="couponDownLine" parameterType="com.iformall.domain.po.WxTopic"> | <update id="couponDownLine" parameterType="com.iformall.domain.po.WxTopic"> | ||||
| update wx_coupon_channel set status = 1 where target_ad = 8 and sub_target_id in( | |||||
| update wx_coupon_channel set status = 1 where status = 0 and target_ad = 8 and sub_target_id in( | |||||
| select id from wx_topic where status in(2,3) and tenant_id = #{tenantId} | select id from wx_topic where status in(2,3) and tenant_id = #{tenantId} | ||||
| ) | ) | ||||
| </update> | </update> | ||||
| </mapper> | </mapper> | ||||