| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import com.ruoyi.common.annotation.NotRepeatCommit; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.enums.OrganEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.domain.BaseOnlyvalue; |
| | | import com.ruoyi.project.domain.ServiceDonatecompletioninfo; |
| | | import com.ruoyi.project.domain.ServiceDonateorgan; |
| | | import com.ruoyi.project.domain.vo.DonationWitnessVO; |
| | | import com.ruoyi.project.domain.vo.TimeVO; |
| | | import com.ruoyi.project.mapper.BaseOnlyvalueMapper; |
| | | import com.ruoyi.project.service.IBaseOnlyvalueService; |
| | | import com.ruoyi.project.service.IServiceDonatebaseinfoService; |
| | | import com.ruoyi.project.service.IServiceDonateorganService; |
| | | import com.ruoyi.project.service.impl.BaseOnlyvalueServiceImpl; |
| | | import com.ruoyi.web.controller.common.OnlyValueCommon; |
| | | import freemarker.template.Configuration; |
| | | import freemarker.template.Template; |
| | | import freemarker.template.TemplateException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | * @author ruoyi |
| | | * @date 2021-11-17 |
| | | */ |
| | | @Slf4j |
| | | @Api("捐献见证管理") |
| | | @RestController |
| | | @RequestMapping("/project/donationwitness") |
| | |
| | | return AjaxResult.success(serviceDonationwitnessService.getStats(timeVO)); |
| | | } |
| | | |
| | | @RepeatSubmit |
| | | @ApiOperation("新增或修改捐献见证管理") |
| | | @Log(title = "捐献完成", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/saveOrUpdateDonationwitness") |
| | | public AjaxResult saveOrUpdateDonationwitness(@RequestBody List<ServiceDonationwitness> serviceDonationwitnessList) { |
| | | if (CollectionUtils.isEmpty(serviceDonationwitnessList)) { |
| | | throw new BaseException("请检查需要新增或修改的捐献见证管理参数是否完整"); |
| | | } |
| | | Boolean i = null; |
| | | for (ServiceDonationwitness serviceDonationwitness : serviceDonationwitnessList) { |
| | | log.info("捐献见证管理id是否为空 : {},基础表的id为 : {}", serviceDonationwitness.getId(), serviceDonationwitness.getInfoid()); |
| | | if (serviceDonationwitness.getId() == null) { |
| | | i = serviceDonationwitnessService.save(serviceDonationwitness); |
| | | } else { |
| | | i = serviceDonationwitnessService.updateById(serviceDonationwitness); |
| | | } |
| | | } |
| | | return toAjax(i); |
| | | } |
| | | |
| | | } |