考试中的试卷修改

新增商品修改
This commit is contained in:
wuchunlei
2024-09-11 15:40:01 +08:00
parent 00d8d10c2b
commit 50a63e3281
2 changed files with 8 additions and 26 deletions

View File

@@ -242,10 +242,14 @@ public class ClassExamServiceImpl extends ServiceImpl<ClassExamDao, ClassExam> i
public R examingPaper() {
ClassExamUser classExamUser = classExamUserDao.selectOne(new LambdaQueryWrapper<ClassExamUser>()
.eq(ClassExamUser::getUserId,ShiroUtils.getUId()).eq(ClassExamUser::getScoreSuccess,0));
if (classExamUser!=null){
ClassEntity classEntity = classEntityDao.selectById(classExamUser.getClassId());
ClassModel classModel = classModelDao.selectById(classEntity.getModelId());
return R.ok().put("classExamUser",classExamUser)
.put("planEndTime",DateUtils.addDateMinutes(classExamUser.getStartTime(),classModel.getExamTime()));
}else {
return R.ok().put("classExamUser",null).put("planEndTime",null);
}
}
@Override

View File

@@ -32,8 +32,6 @@ public class ShopProductController {
@Autowired
private ShopProductService shopProductService;
@Autowired
private ShopProductBookService shopProductBookService;
/**
* 列表
@@ -61,27 +59,7 @@ public class ShopProductController {
@RequestMapping("/addProduct")
public R addProduct(@RequestBody ShopProduct shopProduct){
shopProduct.setCreateTime(new Date());
String bkids = "";
for (String s : shopProduct.getBookids()) {
bkids += s + ",";
}
if (bkids != null && !bkids.isEmpty()) {
String substring = bkids.substring(0, bkids.length() - 1);
shopProduct.setBookId(substring);
} else {
shopProduct.setBookId("");
}
shopProductService.save(shopProduct);
ShopProductBookEntity shopProductBookEntity = new ShopProductBookEntity();
for (String s : shopProduct.getBookids()) {
String bookIdList = s;
if (bookIdList != null) {
Integer product = shopProduct.getProductId();
shopProductBookEntity.setProductId(product);
shopProductBookEntity.setBookId(Integer.valueOf(bookIdList));
shopProductBookService.save(shopProductBookEntity);
}
}
return R.ok();
}