liusheng
2023-10-19 f80df09d8dee5c731cb42d4e3d18f627e32bdaea
ruoyi-admin/src/main/java/com/ruoyi/web/controller/project/ServiceRelativesconfirmationController.java
@@ -20,6 +20,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -47,8 +48,7 @@
@Api("亲属确认管理")
@RestController
@RequestMapping("/project/relativesconfirmation")
public class ServiceRelativesconfirmationController extends BaseController
{
public class ServiceRelativesconfirmationController extends BaseController {
    @Autowired
    private IServiceRelativesconfirmationService serviceRelativesconfirmationService;
@@ -72,16 +72,14 @@
    @ApiOperation("获取亲属确认列表")
    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:list')")
    @GetMapping("/list")
    public TableDataInfo list(ServiceRelativesconfirmation serviceRelativesconfirmation)
    {
    public TableDataInfo list(ServiceRelativesconfirmation serviceRelativesconfirmation) {
        startPage();
        List<ServiceRelativesconfirmation> list = serviceRelativesconfirmationService.queryList(serviceRelativesconfirmation);
        return getDataTable(list);
    }
    @GetMapping("/listnew")
    public TableDataInfo listnew (RelativeConfirmationVO relativeConfirmationVO)
    {
    public TableDataInfo listnew(RelativeConfirmationVO relativeConfirmationVO) {
        startPage();
        List<RelativeConfirmationVO> list = serviceRelativesconfirmationService.selectVOList(relativeConfirmationVO);
        return getDataTable(list);
@@ -95,8 +93,7 @@
    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:export')")
    @Log(title = "捐献亲属确认", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(ServiceRelativesconfirmation serviceRelativesconfirmation)
    {
    public AjaxResult export(ServiceRelativesconfirmation serviceRelativesconfirmation) {
        List<ServiceRelativesconfirmation> list = serviceRelativesconfirmationService.queryList(serviceRelativesconfirmation);
        ExcelUtil<ServiceRelativesconfirmation> util = new ExcelUtil<ServiceRelativesconfirmation>(ServiceRelativesconfirmation.class);
        return util.exportExcel(list, "捐献亲属确认数据");
@@ -108,8 +105,7 @@
    @ApiOperation("通过id获取亲属确认信息")
    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(serviceRelativesconfirmationService.getById(id));
    }
@@ -121,8 +117,7 @@
    @Log(title = "捐献亲属确认", businessType = BusinessType.INSERT)
    @PostMapping
    @RepeatSubmit
    public AjaxResult add(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation)
    {
    public AjaxResult add(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) {
        return toAjax(serviceRelativesconfirmationService.save(serviceRelativesconfirmation));
    }
@@ -134,8 +129,14 @@
    @Log(title = "捐献亲属确认", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @RepeatSubmit    
    public AjaxResult edit(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation)
    {
    public AjaxResult edit(@RequestBody ServiceRelativesconfirmation serviceRelativesconfirmation) {
        ServiceRelativesconfirmation serviceRelativesconfirmation1 = new ServiceRelativesconfirmation();
        serviceRelativesconfirmation1.setInfoid(serviceRelativesconfirmation.getInfoid());
        List<ServiceRelativesconfirmation> list = serviceRelativesconfirmationService.queryList(serviceRelativesconfirmation1);
        if (CollectionUtils.isEmpty(list)) {
            return error("捐献亲属确认数据不存在,请检查后再次修改");
        }
        serviceRelativesconfirmation.setId(list.get(0).getId());
        return toAjax(serviceRelativesconfirmationService.updateById(serviceRelativesconfirmation));
    }
@@ -146,8 +147,7 @@
    //@PreAuthorize("@ss.hasPermi('project:relativesconfirmation:remove')")
    @Log(title = "捐献亲属确认", businessType = BusinessType.DELETE)
    @GetMapping("/remove/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(serviceRelativesconfirmationService.removeByIds(Arrays.asList(ids)));
    }
@@ -197,8 +197,10 @@
        map.put("downloadUrl","/profile/download/wordtemplate/"+name+".doc");
        return map;
    }
    /**
     * 注意dataMap里存放的数据Key值要与模板中的参数相对应
     *
     * @param dataMap
     */
    private void getData(Map dataMap,Long id){