| | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.DtoConversionUtils; |
| | | import com.ruoyi.project.domain.ServiceReimbursementdetailVO; |
| | | import com.ruoyi.project.service.IServiceReimbursementdetailSharedService; |
| | | import io.swagger.annotations.Api; |
| | | 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; |
| | |
| | | @Log(title = "报销申请明细", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody ServiceReimbursementdetail serviceReimbursementdetail) { |
| | | public AjaxResult add(@RequestBody ServiceReimbursementdetailVO serviceReimbursementdetailVO) { |
| | | ServiceReimbursementdetail serviceReimbursementdetail = DtoConversionUtils.sourceToTarget(serviceReimbursementdetailVO, ServiceReimbursementdetail.class); |
| | | if (!CollectionUtils.isEmpty(serviceReimbursementdetailVO.getAnnexfilesList())) { |
| | | serviceReimbursementdetail.setAnnexfiles(JSON.toJSONString(serviceReimbursementdetailVO.getAnnexfilesList())); |
| | | } |
| | | return toAjax(serviceReimbursementdetailService.save(serviceReimbursementdetail)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("修改报销申请明细") |
| | | //@PreAuthorize("@ss.hasPermi('project:reimbursementdetail:edit')") |
| | | @Log(title = "报销申请明细", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @PostMapping("/reimbursementdetailEdit") |
| | | //@RepeatSubmit |
| | | public AjaxResult edit(@RequestBody ServiceReimbursementdetail serviceReimbursementdetail) { |
| | | public AjaxResult edit(@RequestBody ServiceReimbursementdetailVO serviceReimbursementdetailVO) { |
| | | ServiceReimbursementdetail serviceReimbursementdetail = DtoConversionUtils.sourceToTarget(serviceReimbursementdetailVO, ServiceReimbursementdetail.class); |
| | | if (!CollectionUtils.isEmpty(serviceReimbursementdetailVO.getAnnexfilesList())) { |
| | | //对前端传过来的数组,进行JSON序列化,并赋值给Annexfiles |
| | | serviceReimbursementdetail.setAnnexfiles(JSON.toJSONString(serviceReimbursementdetailVO.getAnnexfilesList())); |
| | | } |
| | | return toAjax(serviceReimbursementdetailService.updateById(serviceReimbursementdetail)); |
| | | } |
| | | |