| | |
| | | |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.enums.OrganEnum; |
| | | 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.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; |
| | |
| | | @Api("捐献见证管理") |
| | | @RestController |
| | | @RequestMapping("/project/donationwitness") |
| | | public class ServiceDonationwitnessController extends BaseController |
| | | { |
| | | public class ServiceDonationwitnessController extends BaseController { |
| | | @Autowired |
| | | private IServiceDonationwitnessService serviceDonationwitnessService; |
| | | |
| | | @Autowired |
| | | private IBaseOnlyvalueService baseOnlyvalueService; |
| | | |
| | | @Autowired |
| | | private IServiceDonateorganService serviceDonateorganService; |
| | |
| | | @Autowired |
| | | private IServiceDonatebaseinfoService serviceDonatebaseinfoService; |
| | | |
| | | @Autowired |
| | | private OnlyValueCommon onlyValueCommon; |
| | | |
| | | |
| | | private static Configuration configuration = null; |
| | |
| | | @ApiOperation("获取捐献见证列表") |
| | | //@PreAuthorize("@ss.hasPermi('project:donationwitness:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ServiceDonationwitness serviceDonationwitness) |
| | | { |
| | | public TableDataInfo list(ServiceDonationwitness serviceDonationwitness) { |
| | | startPage(); |
| | | List<ServiceDonationwitness> list = serviceDonationwitnessService.queryList(serviceDonationwitness); |
| | | return getDataTable(list); |
| | |
| | | |
| | | @ApiOperation("获取捐献见证列表-新") |
| | | @GetMapping("/listnew") |
| | | public TableDataInfo listnew(DonationWitnessVO donationWitnessVO) |
| | | { |
| | | public TableDataInfo listnew(DonationWitnessVO donationWitnessVO) { |
| | | startPage(); |
| | | List<DonationWitnessVO> list = serviceDonationwitnessService.selectVOList(donationWitnessVO); |
| | | return getDataTable(list); |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:donationwitness:export')") |
| | | @Log(title = "捐献见证", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(ServiceDonationwitness serviceDonationwitness) |
| | | { |
| | | public AjaxResult export(ServiceDonationwitness serviceDonationwitness) { |
| | | List<ServiceDonationwitness> list = serviceDonationwitnessService.queryList(serviceDonationwitness); |
| | | ExcelUtil<ServiceDonationwitness> util = new ExcelUtil<ServiceDonationwitness>(ServiceDonationwitness.class); |
| | | return util.exportExcel(list, "捐献见证数据"); |
| | |
| | | @ApiOperation("通过id获取见证信息") |
| | | //@PreAuthorize("@ss.hasPermi('project:donationwitness:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(serviceDonationwitnessService.getById(id)); |
| | | } |
| | | |
| | |
| | | @Log(title = "捐献见证", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody ServiceDonationwitness serviceDonationwitness) |
| | | { |
| | | public AjaxResult add(@RequestBody ServiceDonationwitness serviceDonationwitness) { |
| | | |
| | | return toAjax(serviceDonationwitnessService.save(serviceDonationwitness)); |
| | | } |
| | | |
| | |
| | | @Log(title = "捐献见证", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceDonationwitness serviceDonationwitness) |
| | | { |
| | | public AjaxResult edit(@RequestBody ServiceDonationwitness serviceDonationwitness) { |
| | | int last = -1; |
| | | if (StringUtils.isNotEmpty(serviceDonationwitness.getDonorno())) { |
| | | last = serviceDonationwitness.getDonorno().lastIndexOf("*"); |
| | | } |
| | | //捐献者编号最后一位是 * ,才可以往唯一里表加数据 |
| | | if (last == serviceDonationwitness.getDonorno().length()) { |
| | | onlyValueCommon.addOnlyValue("donationwitness"); |
| | | } |
| | | |
| | | return toAjax(serviceDonationwitnessService.updateById(serviceDonationwitness)); |
| | | } |
| | | |
| | |
| | | //@PreAuthorize("@ss.hasPermi('project:donationwitness:remove')") |
| | | @Log(title = "捐献见证", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(serviceDonationwitnessService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/getByInfoId/{infoid}") |
| | | public AjaxResult getByInfoId(@PathVariable("infoid") Long infoid) |
| | | { |
| | | public AjaxResult getByInfoId(@PathVariable("infoid") Long infoid) { |
| | | return AjaxResult.success(serviceDonationwitnessService.getByInfoId(infoid)); |
| | | } |
| | | |
| | |
| | | map.put("downloadUrl","/profile/download/wordtemplate/"+name+".doc"); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 注意dataMap里存放的数据Key值要与模板中的参数相对应 |
| | | * |
| | | * @param dataMap |
| | | */ |
| | | private void getData(Map dataMap, Long id){ |
| | |
| | | |
| | | @ApiOperation("数据大屏获取占比统计") |
| | | @GetMapping(value = "/getStats") |
| | | public AjaxResult getStats(TimeVO timeVO) |
| | | { |
| | | public AjaxResult getStats(TimeVO timeVO) { |
| | | return AjaxResult.success(serviceDonationwitnessService.getStats(timeVO)); |
| | | } |
| | | |