Browse Source

[消息和专题][修改][修复死锁问题]

release_toaliyun_real
luozukai 7 years ago
parent
commit
c53144eb9e
6 changed files with 16 additions and 14 deletions
  1. +0
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java
  2. +3
    -3
      mallinkService/src/main/java/com/iformall/mq/impl/RabbitMqMessageProducer.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxMsgRecordServiceImpl.java
  5. +5
    -3
      mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml
  6. +6
    -4
      mallinkService/src/main/resources/mapper/WxTopicMapper.xml

+ 0
- 2
mallinkAdmin/src/main/java/com/iformall/controller/sys/WxBusinessController.java View File

@@ -10,12 +10,10 @@ import com.iformall.service.WxBusinessService;
import com.iformall.service.WxSubBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.map.LinkedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;


+ 3
- 3
mallinkService/src/main/java/com/iformall/mq/impl/RabbitMqMessageProducer.java View File

@@ -13,7 +13,6 @@ import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
@@ -32,15 +31,16 @@ public class RabbitMqMessageProducer implements MqBaseProducer {
@Autowired
private WxMsgRecordService wxMsgRecordService;


@Override
public void sendMessage(BaseMsg data, String topic, String tags, String keys) {
try {
data.setUuid(UUID.randomUUID().toString());
wxMsgRecordService.save(data);

rabbitTemplate.convertAndSend(topic, JsonUtil.obj2Json(data));

wxMsgRecordService.save(data);
data.setMsgStatus(EnumMsgRecordStatus.SEND_SUCC.getCode());
wxMsgRecordMapper.update(data);
} catch (Exception e) {
log.error("RabbitMqMessageProducer: Send Message Error ", e);
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java View File

@@ -138,7 +138,7 @@ public class WxFlowServiceImpl implements WxFlowService {
if(supplement!=null && supplement && EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
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.setId(businessId);
wxPropertyContract.setApplyStatus(applyStatus);


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxMsgRecordServiceImpl.java View File

@@ -46,7 +46,7 @@ public class WxMsgRecordServiceImpl implements WxMsgRecordService {
msgRecord.setUuid(data.getUuid());
msgRecord.setId(idWorker.nextId());
msgRecord.setMsgJson(JsonUtil.obj2Json(data));
msgRecord.setMsgStatus(EnumMsgRecordStatus.SEND_SUCC.getCode());
msgRecord.setMsgStatus(EnumMsgRecordStatus.DEFAULT.getCode());
wxMsgRecordMapper.save(msgRecord);
}



+ 5
- 3
mallinkService/src/main/resources/mapper/WxMsgRecordMapper.xml View File

@@ -63,9 +63,11 @@
update wx_msg_record set updatetime = now()
<if test=" null != msgStatus ">,msg_status = #{msgStatus}</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>

<select id="findList" parameterType="com.iformall.domain.po.msg.WxMsgRecord" resultMap="BaseResultMap">


+ 6
- 4
mallinkService/src/main/resources/mapper/WxTopicMapper.xml View File

@@ -87,15 +87,17 @@
</select>

<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 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}
)
</update>


</mapper>

Loading…
Cancel
Save