作者 kgy

修改查询在修改造成死锁

package com.synthesize_energy.item.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
... ... @@ -16,7 +17,7 @@ import java.util.Date;
*/
@Data
@TableName("synthesize_no_1")
public class Synthesize_no_1 implements Serializable {
public class Synthesize_no_1 extends Model<Synthesize_no_1> implements Serializable {
private static final long serialVersionUID = 4315624380474106909L;
@TableId(type = IdType.ID_WORKER_STR)
private String id;
... ...
... ... @@ -29,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
... ... @@ -46,7 +47,7 @@ import java.util.stream.Collectors;
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
//@Transactional(rollbackFor = Exception.class)
public class ProjectServiceImpl implements ProjectService {
@Autowired
... ... @@ -274,6 +275,7 @@ public class ProjectServiceImpl implements ProjectService {
}
@Override
@Transactional(propagation = Propagation.SUPPORTS)
public No_3_1Tall_Dto no3_1_1GetType(String id) {
Synthesize_no_1 byId = no_1Service.getById(id);
byId.setCountState("1");
... ... @@ -1485,7 +1487,7 @@ public class ProjectServiceImpl implements ProjectService {
double totalAnnualTotalHotWaterRequirement = 0.0;
for (Synthesize_no_2_1 synthesize_no_2_1 : synthesize_no_2_1s) {
CalculateLoad calculateLoad = calculateLoadService.getById(synthesize_no_2_1.getId());
if (Objects.nonNull(calculateLoad.getNo44())){
if (Objects.nonNull(calculateLoad.getNo44())) {
totalAnnualTotalHotWaterRequirement += calculateLoad.getNo44();
}
}
... ...