考试中的试卷修改
新增商品修改
This commit is contained in:
@@ -242,10 +242,14 @@ public class ClassExamServiceImpl extends ServiceImpl<ClassExamDao, ClassExam> i
|
|||||||
public R examingPaper() {
|
public R examingPaper() {
|
||||||
ClassExamUser classExamUser = classExamUserDao.selectOne(new LambdaQueryWrapper<ClassExamUser>()
|
ClassExamUser classExamUser = classExamUserDao.selectOne(new LambdaQueryWrapper<ClassExamUser>()
|
||||||
.eq(ClassExamUser::getUserId,ShiroUtils.getUId()).eq(ClassExamUser::getScoreSuccess,0));
|
.eq(ClassExamUser::getUserId,ShiroUtils.getUId()).eq(ClassExamUser::getScoreSuccess,0));
|
||||||
ClassEntity classEntity = classEntityDao.selectById(classExamUser.getClassId());
|
if (classExamUser!=null){
|
||||||
ClassModel classModel = classModelDao.selectById(classEntity.getModelId());
|
ClassEntity classEntity = classEntityDao.selectById(classExamUser.getClassId());
|
||||||
return R.ok().put("classExamUser",classExamUser)
|
ClassModel classModel = classModelDao.selectById(classEntity.getModelId());
|
||||||
.put("planEndTime",DateUtils.addDateMinutes(classExamUser.getStartTime(),classModel.getExamTime()));
|
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
|
@Override
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ public class ShopProductController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopProductService shopProductService;
|
private ShopProductService shopProductService;
|
||||||
@Autowired
|
|
||||||
private ShopProductBookService shopProductBookService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
@@ -61,27 +59,7 @@ public class ShopProductController {
|
|||||||
@RequestMapping("/addProduct")
|
@RequestMapping("/addProduct")
|
||||||
public R addProduct(@RequestBody ShopProduct shopProduct){
|
public R addProduct(@RequestBody ShopProduct shopProduct){
|
||||||
shopProduct.setCreateTime(new Date());
|
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);
|
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();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user