|
|
|
@ -855,38 +855,58 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
|
|
|
|
|
if (type.equals("财产分配")) {
|
|
|
|
|
CaseDistributionOfPropertyFamilyDto dto = gson.fromJson(json, CaseDistributionOfPropertyFamilyDto.class);
|
|
|
|
|
dto.setCaseDistributionOfPropertyId(IdUtil.randomUUID());
|
|
|
|
|
if (operator.equals("master")) {
|
|
|
|
|
dto.setCaseid(IdUtil.randomUUID());
|
|
|
|
|
}
|
|
|
|
|
CaseDistributionOfPropertyWithBLOBs caseDistributionOfPropertyWithBLOBs = new CaseDistributionOfPropertyWithBLOBs();
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(dto, caseDistributionOfPropertyWithBLOBs);
|
|
|
|
|
//id为空 新增
|
|
|
|
|
if (StringUtils.isBlank(dto.getCaseDistributionOfPropertyId())) {
|
|
|
|
|
BeanUtils.copyProperties(dto, caseDistributionOfPropertyWithBLOBs);
|
|
|
|
|
dto.setCaseDistributionOfPropertyId(IdUtil.randomUUID());
|
|
|
|
|
caseDistributionOfPropertyWithBLOBs.setCaseDistributionOfPropertyId(IdUtil.randomUUID());
|
|
|
|
|
caseDistributionOfPropertyMapper.insert(caseDistributionOfPropertyWithBLOBs);
|
|
|
|
|
|
|
|
|
|
//需要多存一张记录表,多条数据
|
|
|
|
|
if (operator.equals("stu")) {
|
|
|
|
|
List<CaseDistributionOfPropertyFamilyRecords> recordsList = dto.getCaseDistributionOfPropertyFamilyRecordsList();
|
|
|
|
|
List<CaseDistributionOfPropertyFamilyRecords> addList = dto.getCaseDistributionOfPropertyFamilyRecordsList();
|
|
|
|
|
for (CaseDistributionOfPropertyFamilyRecords caseDistributionOfPropertyFamilyRecords : recordsList) {
|
|
|
|
|
}
|
|
|
|
|
//需要多存一张记录表,多条数据
|
|
|
|
|
if (operator.equals("stu")) {
|
|
|
|
|
List<CaseDistributionOfPropertyFamilyRecords> recordsList = dto.getCaseDistributionOfPropertyFamilyRecordsList();
|
|
|
|
|
List<CaseDistributionOfPropertyFamilyRecords> addList = new ArrayList<>();
|
|
|
|
|
for (CaseDistributionOfPropertyFamilyRecords caseDistributionOfPropertyFamilyRecords : recordsList) {
|
|
|
|
|
if (StringUtils.isBlank(caseDistributionOfPropertyFamilyRecords.getCaseDistributionOfPropertyFamilyRecordsId())) {
|
|
|
|
|
caseDistributionOfPropertyFamilyRecords.setCaseDistributionOfPropertyFamilyRecordsId(IdUtil.randomUUID());
|
|
|
|
|
caseDistributionOfPropertyFamilyRecords.setCaseDistributionOfPropertyId(caseDistributionOfPropertyWithBLOBs.getCaseDistributionOfPropertyId());
|
|
|
|
|
caseDistributionOfPropertyFamilyRecords.setCreateTime(new Date());
|
|
|
|
|
addList.add(caseDistributionOfPropertyFamilyRecords);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!addList.isEmpty()) {
|
|
|
|
|
caseDistributionOfPropertyFamilyRecordsMapper.batchInsert(addList);
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功!");
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功!");
|
|
|
|
|
}
|
|
|
|
|
//学生提交编辑
|
|
|
|
|
if (operator.equals("stu")) {
|
|
|
|
|
String userId = dto.getUserId();
|
|
|
|
|
ResultEntity<HttpStatus> result = getHttpStatusResultEntity(dto.getCaseid(), userId);
|
|
|
|
|
if (result != null) return result;
|
|
|
|
|
} //老师和学生编辑都走这里
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//老师和学生编辑都走这里
|
|
|
|
|
caseDistributionOfPropertyMapper.updateByPrimaryKeySelective(caseDistributionOfPropertyWithBLOBs);
|
|
|
|
|
|
|
|
|
|
List<CaseDistributionOfPropertyFamilyRecords> recordsList = dto.getCaseDistributionOfPropertyFamilyRecordsList();
|
|
|
|
|
if (!recordsList.isEmpty()) {
|
|
|
|
|
for (CaseDistributionOfPropertyFamilyRecords caseDistributionOfPropertyFamilyRecords : recordsList) {
|
|
|
|
|
//先删掉老数据
|
|
|
|
|
CaseDistributionOfPropertyFamilyRecordsExample example = new CaseDistributionOfPropertyFamilyRecordsExample();
|
|
|
|
|
example.createCriteria().andCaseidEqualTo(caseDistributionOfPropertyFamilyRecords.getCaseid()).andUserIdEqualTo(caseDistributionOfPropertyFamilyRecords.getUserId())
|
|
|
|
|
.andCaseDistributionOfPropertyIdEqualTo(caseDistributionOfPropertyFamilyRecords.getCaseDistributionOfPropertyId());
|
|
|
|
|
List<CaseDistributionOfPropertyFamilyRecords> list = caseDistributionOfPropertyFamilyRecordsMapper.selectByExample(example);
|
|
|
|
|
if (!list.isEmpty()) {
|
|
|
|
|
caseDistributionOfPropertyFamilyRecordsMapper.deleteByPrimaryKey(list.get(0).getCaseDistributionOfPropertyFamilyRecordsId());
|
|
|
|
|
}
|
|
|
|
|
caseDistributionOfPropertyFamilyRecordsMapper.insert(caseDistributionOfPropertyFamilyRecords);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK, "编辑成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1045,7 +1065,7 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.OK,"操作成功");
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.OK, "操作成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CaseInfo newCase = new CaseInfo();
|
|
|
|
@ -1182,23 +1202,23 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
// return new ResultEntity<HttpStatus>(HttpStatus.OK, "操作成功!");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ResultEntity<HttpStatus> teaOrAdminUpdateOrInsertInvestmentPlan(CaseInvestmentPlanDto
|
|
|
|
|
caseInvestmentPlanDto) {
|
|
|
|
|
if (caseInvestmentPlanDto.getInvestmentPlan() == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
CaseInvestmentPlan investmentPlan = caseInvestmentPlanDto.getInvestmentPlan();
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(investmentPlan.getCaseInvestmentPlanId())) { //主键为空为新增
|
|
|
|
|
investmentPlan.setCaseInvestmentPlanId(IdUtil.randomUUID());
|
|
|
|
|
investmentPlanMapper.insert(investmentPlan);
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功!");
|
|
|
|
|
} else {
|
|
|
|
|
investmentPlanMapper.updateByPrimaryKeySelective(investmentPlan);
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.OK, "编辑成功!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// private ResultEntity<HttpStatus> teaOrAdminUpdateOrInsertInvestmentPlan(CaseInvestmentPlanDto
|
|
|
|
|
// caseInvestmentPlanDto) {
|
|
|
|
|
// if (caseInvestmentPlanDto.getInvestmentPlan() == null) {
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
// CaseInvestmentPlan investmentPlan = caseInvestmentPlanDto.getInvestmentPlan();
|
|
|
|
|
//
|
|
|
|
|
// if (StringUtils.isBlank(investmentPlan.getCaseInvestmentPlanId())) { //主键为空为新增
|
|
|
|
|
// investmentPlan.setCaseInvestmentPlanId(IdUtil.randomUUID());
|
|
|
|
|
// investmentPlanMapper.insert(investmentPlan);
|
|
|
|
|
// return new ResultEntity<HttpStatus>(HttpStatus.OK, "新增成功!");
|
|
|
|
|
// } else {
|
|
|
|
|
// investmentPlanMapper.updateByPrimaryKeySelective(investmentPlan);
|
|
|
|
|
// return new ResultEntity<HttpStatus>(HttpStatus.OK, "编辑成功!");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override //重新实训 先把数据库的数据替换成本次数据,再设置实训表中的数据,没分数则加上,有则不改。2、算分只算老师端设置的考核点
|
|
|
|
|
public void commitTraining(String json, String type, String trainingId) {
|
|
|
|
@ -2473,6 +2493,10 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
CaseDistributionOfPropertyFamilyDto objectResultEntity = getObjectResultEntity(caseID, userId, isAnswer);
|
|
|
|
|
map.put(allType, objectResultEntity);
|
|
|
|
|
}
|
|
|
|
|
if (allType.equals("财产传承")) {
|
|
|
|
|
CaseHeritageWithBLOBs resultEntity = getResultEntity(caseID, userId, isAnswer);
|
|
|
|
|
map.put(allType, resultEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return new ResultEntity<>(map);
|
|
|
|
|
}
|
|
|
|
|