| | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | | import com.ruoyi.system.model.TSysInspection; |
| | | import com.ruoyi.system.service.TCrmClinicService; |
| | | import com.ruoyi.system.service.TSysInspectionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class TSysInspectionController { |
| | | |
| | | private final TSysInspectionService sysInspectionService; |
| | | private final TokenService tokenService; |
| | | private final TCrmClinicService crmClinicService; |
| | | @Autowired |
| | | public TSysInspectionController(TSysInspectionService sysInspectionService) { |
| | | public TSysInspectionController(TSysInspectionService sysInspectionService, TokenService tokenService, TCrmClinicService crmClinicService) { |
| | | this.sysInspectionService = sysInspectionService; |
| | | this.tokenService = tokenService; |
| | | this.crmClinicService = crmClinicService; |
| | | } |
| | | |
| | | // /** |
| | |
| | | @ApiOperation(value = "添加用户检测信息管理") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TSysInspection dto) { |
| | | dto.setIsPay(1); |
| | | String checkTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); |
| | | dto.setCheckTime(checkTime); |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | TCrmClinic crmClinic = crmClinicService.getOne(Wrappers.lambdaQuery(TCrmClinic.class) |
| | | .eq(TCrmClinic::getUserId, userId) |
| | | .last("LIMIT 1")); |
| | | dto.setClinicId(crmClinic.getId()); |
| | | return R.ok(sysInspectionService.save(dto)); |
| | | } |
| | | |