|
|
|
@ -6,22 +6,17 @@ import java.util.List; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.hxhq.business.domain.*; |
|
|
|
import com.hxhq.business.dto.gsp.GspListDto; |
|
|
|
import com.hxhq.business.dto.sj.SjListDto; |
|
|
|
import com.hxhq.business.enums.zykgl.DaztEnum; |
|
|
|
import com.hxhq.business.enums.zykgl.JyztEnum; |
|
|
|
import com.hxhq.business.enums.zykgl.ZjztEnum; |
|
|
|
import com.hxhq.business.form.gsp.GspGdForm; |
|
|
|
import com.hxhq.business.form.gsp.GspJyForm; |
|
|
|
import com.hxhq.business.form.gsp.GspSearchListForm; |
|
|
|
import com.hxhq.business.form.mjy.GdForm; |
|
|
|
import com.hxhq.business.form.sj.*; |
|
|
|
import com.hxhq.business.service.ISjService; |
|
|
|
import com.hxhq.business.service.ISjTzService; |
|
|
|
import com.hxhq.business.service.ISjJcgjService; |
|
|
|
import com.hxhq.business.service.IStudySubjectService; |
|
|
|
import com.hxhq.common.security.annotation.RequiresPermissions; |
|
|
|
import com.hxhq.common.security.utils.SecurityUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
@ -49,6 +44,8 @@ public class SjController extends BaseController |
|
|
|
@Autowired |
|
|
|
private ISjTzService sjTzService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IStudySubjectService studySubjectService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 开始配置 |
|
|
|
@ -57,19 +54,20 @@ public class SjController extends BaseController |
|
|
|
@PostMapping("/startConfiguration") |
|
|
|
public AjaxResult startConfiguration(@RequestBody SjBjForm form) { |
|
|
|
Sj sj = sjService.getSjByBh(form.getBh()); |
|
|
|
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId()); |
|
|
|
if(sj == null) { |
|
|
|
sj = new Sj(); |
|
|
|
sj.setBh(form.getBh()); |
|
|
|
sj.setPzrq(new Date()); |
|
|
|
sj.setStudyId(form.getStudyId()); |
|
|
|
sj.setStudyFormId(form.getStudyFormId()); |
|
|
|
sj.setDeptId(form.getDeptId()); |
|
|
|
sj.setDeptId(studySubject.getDeptId()); |
|
|
|
sjService.save(sj); |
|
|
|
} else { |
|
|
|
sj.setPzrq(new Date()); |
|
|
|
sj.setStudyId(form.getStudyId()); |
|
|
|
sj.setStudyFormId(form.getStudyFormId()); |
|
|
|
sj.setDeptId(form.getDeptId()); |
|
|
|
sj.setDeptId(studySubject.getDeptId()); |
|
|
|
sjService.updateById(sj); |
|
|
|
} |
|
|
|
|
|
|
|
@ -84,6 +82,8 @@ public class SjController extends BaseController |
|
|
|
@PostMapping("/configurationCompleted") |
|
|
|
public AjaxResult configurationCompleted(@RequestBody SjBjForm form) { |
|
|
|
Sj sj = sjService.getSjByBh(form.getBh()); |
|
|
|
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId()); |
|
|
|
|
|
|
|
if(sj == null) { |
|
|
|
sj = new Sj(); |
|
|
|
sj.setBh(form.getBh()); |
|
|
|
@ -91,7 +91,7 @@ public class SjController extends BaseController |
|
|
|
sj.setKcdw(form.getKcdw()); |
|
|
|
sj.setStudyId(form.getStudyId()); |
|
|
|
sj.setStudyFormId(form.getStudyFormId()); |
|
|
|
sj.setDeptId(form.getDeptId()); |
|
|
|
sj.setDeptId(studySubject.getDeptId()); |
|
|
|
sj.setNd(form.getNd()); |
|
|
|
sj.setNddw(form.getNddw()); |
|
|
|
sj.setZjzt(ZjztEnum.rk.getValue()); |
|
|
|
@ -103,7 +103,7 @@ public class SjController extends BaseController |
|
|
|
sj.setKcdw(form.getKcdw()); |
|
|
|
sj.setStudyId(form.getStudyId()); |
|
|
|
sj.setStudyFormId(form.getStudyFormId()); |
|
|
|
sj.setDeptId(form.getDeptId()); |
|
|
|
sj.setDeptId(studySubject.getDeptId()); |
|
|
|
sj.setNd(form.getNd()); |
|
|
|
sj.setNddw(form.getNddw()); |
|
|
|
sj.setZjzt(ZjztEnum.rk.getValue()); |
|
|
|
@ -121,9 +121,11 @@ public class SjController extends BaseController |
|
|
|
*/ |
|
|
|
@PostMapping("/subpackage") |
|
|
|
public AjaxResult subpackage(@RequestBody SjSubpackageForm form) { |
|
|
|
/*LambdaQueryWrapper<Sj> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
StudySubject studySubject = studySubjectService.getById(form.getStudySubjectId()); |
|
|
|
|
|
|
|
LambdaQueryWrapper<Sj> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(Sj::getParentBh, form.getBh()); |
|
|
|
sjService.remove(queryWrapper);*/ |
|
|
|
sjService.remove(queryWrapper); |
|
|
|
List<SjSubpackageForm.SjSubpackageItemForm> list = form.getList(); |
|
|
|
List<Sj> sjList = new ArrayList<>(); |
|
|
|
for (SjSubpackageForm.SjSubpackageItemForm sjSubpackageItemForm : list) { |
|
|
|
@ -134,7 +136,7 @@ public class SjController extends BaseController |
|
|
|
sj.setKcdw(sjSubpackageItemForm.getKcdw()); |
|
|
|
sj.setStudyId(form.getStudyId()); |
|
|
|
sj.setStudyFormId(form.getStudyFormId()); |
|
|
|
sj.setDeptId(form.getDeptId()); |
|
|
|
sj.setDeptId(studySubject.getDeptId()); |
|
|
|
sjList.add(sj); |
|
|
|
} |
|
|
|
sjService.saveBatch(sjList); |
|
|
|
|