修复保存详情bug

This commit is contained in:
wulin 2020-10-30 15:51:06 +08:00
parent 2fa844d6fa
commit b8fcd345bb
2 changed files with 37 additions and 2 deletions

View File

@ -430,7 +430,7 @@ public class ResultRecordController extends AbstractController {
scores) { scores) {
if(scoreDto.getApprovalId().longValue() == score.getApprovalId().longValue()){ if(scoreDto.getApprovalId().longValue() == score.getApprovalId().longValue()){
ResultScoreDto scoreDto1 = new ResultScoreDto(); ResultScoreDto scoreDto1 = new ResultScoreDto();
BeanUtils.copyProperties(scoreDto1, score); BeanUtils.copyProperties(score, scoreDto1);
scoreDto1.setApprovalId(scoreDto.getApprovalId()); scoreDto1.setApprovalId(scoreDto.getApprovalId());
scoreDto1.setApprovalName(scoreDto.getApprovalName()); scoreDto1.setApprovalName(scoreDto.getApprovalName());
scoreDto1.setWeight(scoreDto.getWeight()); scoreDto1.setWeight(scoreDto.getWeight());
@ -604,6 +604,7 @@ public class ResultRecordController extends AbstractController {
}else{ }else{
updateScores.add(resultScore); updateScores.add(resultScore);
} }
resultScore.setDetailId(detailDto.getId());
} }
resultDetail.setAcquireScore(score); resultDetail.setAcquireScore(score);
weight = weight.add(resultDetail.getCheckWeight()); weight = weight.add(resultDetail.getCheckWeight());

View File

@ -3,6 +3,7 @@ package com.lz.mysql;
import com.lz.common.utils.StringUtil; import com.lz.common.utils.StringUtil;
import com.lz.modules.flow.entity.FlowChartRole; import com.lz.modules.flow.entity.FlowChartRole;
import org.springframework.util.ResourceUtils; import org.springframework.util.ResourceUtils;
import org.springframework.util.StopWatch;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
@ -49,11 +50,43 @@ public class MysqlMain {
public static String dto_exclude = ",is_delete,gmt_create,gmt_modified,";//生成dto时排除字段前后都要加英文逗号 public static String dto_exclude = ",is_delete,gmt_create,gmt_modified,";//生成dto时排除字段前后都要加英文逗号
public static String req_exclude = ",,";//生成Req时排除字段前后都要加英文逗号 public static String req_exclude = ",,";//生成Req时排除字段前后都要加英文逗号
public static class TestStaticAndHuo{
public static int compare(Long a, Long b){
return a.compareTo(b);
}
public static boolean isEmpt(String str){
return str == null || str.length() == 0;
}
}
/** /**
* @param args * @param args
*/ */
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
/*Long a = 2l;
Long b = 3l;
String value = "aaa";
StopWatch stopWatch = new StopWatch();
stopWatch.start("测试静态方法");
for(int i = 0; i < 10000; i++){
if(TestStaticAndHuo.isEmpt(value)){
}
}
stopWatch.stop();
stopWatch.start("测试对象方法");
for(int i = 0; i < 10000; i++){
if(value == null || value.length() == 0){
}
}
stopWatch.stop();
System.out.println(stopWatch.prettyPrint());*/
/*List<TestMap> testMaps = new ArrayList<>(); /*List<TestMap> testMaps = new ArrayList<>();
TestMap test = new TestMap(); TestMap test = new TestMap();
test.setName("123"); test.setName("123");
@ -78,7 +111,6 @@ public class MysqlMain {
} }
}).collect(Collectors.joining(","));*/ }).collect(Collectors.joining(","));*/
String path = ResourceUtils.getURL("classpath:").getPath(); String path = ResourceUtils.getURL("classpath:").getPath();
System.out.println(path); System.out.println(path);
String dir = null; String dir = null;
@ -147,6 +179,8 @@ public class MysqlMain {
for (int i = 0; i < list2.size(); i++) { for (int i = 0; i < list2.size(); i++) {
MysqlUtilTable2XML.printXMLForMap(list2.get(i)); MysqlUtilTable2XML.printXMLForMap(list2.get(i));
} }
} }
} }