| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.project.domain.ServiceTransport; |
| | | import com.ruoyi.project.domain.ServiceTransportFile; |
| | | import com.ruoyi.project.service.IServiceTransportService; |
| | | import com.ruoyi.project.service.impl.ServiceTransportFileServiceImpl; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @author ruoyi |
| | | * @date 2025-12-15 |
| | | */ |
| | | @Api(description = "供者转运登记") |
| | | @Api(description = "供者转运登记",tags = {"供者转运登记"}) |
| | | @RestController |
| | | @RequestMapping("/project/transport") |
| | | public class ServiceTransportController extends BaseController { |
| | |
| | | @Autowired |
| | | private ServiceTransportFileServiceImpl serviceTransportFileService; |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | /** |
| | | * 查询供者转运登记列表 |
| | | */ |
| | | @ApiOperation("查询供者转运登记列表") |
| | | // @PreAuthorize("@ss.hasPermi('system:transport:list')") |
| | | @PostMapping("/list") |
| | | public Map<String, Object> list(ServiceTransport serviceTransport) { |
| | | public Map<String, Object> list(@RequestBody ServiceTransport serviceTransport) { |
| | | Long userId= getUserId(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | if(user!=null&&user.getUserType()!=null&&!user.getUserType().equals("00")){ |
| | | serviceTransport.setNotAdminId(user.getUserName()); |
| | | } |
| | | Page<ServiceTransport> serviceTransportPage = serviceTransportService.queryList(serviceTransport); |
| | | return getDataTable(serviceTransportPage.getRecords(), (int) serviceTransportPage.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 查询供者转运登记列表 |
| | | */ |
| | | @ApiOperation("转运登记状态统计") |
| | | // @PreAuthorize("@ss.hasPermi('system:transport:list')") |
| | | @PostMapping("/totalServiceTransportState") |
| | | public AjaxResult totalState(@RequestBody ServiceTransport serviceTransport) { |
| | | Long userId= getUserId(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | if(user!=null&&user.getUserType()!=null&&!user.getUserType().equals("00")){ |
| | | serviceTransport.setNotAdminId(user.getUserName()); |
| | | } |
| | | |
| | | return AjaxResult.success(serviceTransportService.totalState(serviceTransport)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "供者转运登记", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(ServiceTransport serviceTransport) { |
| | | Long userId= getUserId(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | if(user!=null&&user.getUserType()!=null&&!user.getUserType().equals("00")){ |
| | | serviceTransport.setNotAdminId(user.getUserId()+""); |
| | | } |
| | | List<ServiceTransport> list = serviceTransportService.queryList(serviceTransport).getRecords(); |
| | | ExcelUtil<ServiceTransport> util = new ExcelUtil<ServiceTransport>(ServiceTransport.class); |
| | | return util.exportExcel(list, "供者转运登记数据"); |
| | |
| | | ServiceTransportFile serviceTransportFile = new ServiceTransportFile(); |
| | | serviceTransportFile.setDelFlag(0); |
| | | serviceTransportFile.setTransportId(transport.getId()); |
| | | serviceTransportFile.setCaseNo(transport.getCaseNo()); |
| | | List<ServiceTransportFile> serviceTransportFiles = serviceTransportFileService.queryList(serviceTransportFile); |
| | | transport.setAnnexfilesList(serviceTransportFiles); |
| | | } |
| | |
| | | public AjaxResult edit(@RequestBody ServiceTransport serviceTransport) { |
| | | boolean b = serviceTransportService.updateById(serviceTransport); |
| | | if (b) { |
| | | serviceTransportFileService.updateList(serviceTransport.getAnnexfilesList(), serviceTransport.getReportId(), serviceTransport.getCaseNo(), getNickName()); |
| | | serviceTransportFileService.updateList(serviceTransport.getAnnexfilesList(), serviceTransport.getId(), serviceTransport.getCaseNo(), getNickName()); |
| | | } |
| | | return toAjax(b); |
| | | } |