| | |
| | | |
| | | import cn.flightfeather.supervision.common.pdf.DynamicParam |
| | | import cn.flightfeather.supervision.common.pdf.GeneratePdfUtil |
| | | import cn.flightfeather.supervision.common.pdf.PdfUtil |
| | | import cn.flightfeather.supervision.domain.entity.Commitment |
| | | import cn.flightfeather.supervision.domain.entity.CommitmentTemplate |
| | | import cn.flightfeather.supervision.domain.enumeration.SceneType |
| | | import cn.flightfeather.supervision.domain.enumeration.UserType |
| | | import cn.flightfeather.supervision.domain.mapper.CommitmentMapper |
| | | import cn.flightfeather.supervision.domain.mapper.UserinfoMapper |
| | | import cn.flightfeather.supervision.infrastructure.utils.DateUtil |
| | |
| | | import com.fasterxml.jackson.module.kotlin.readValue |
| | | import com.github.pagehelper.PageHelper |
| | | import com.google.gson.Gson |
| | | import net.coobird.thumbnailator.tasks.io.InputStreamImageSource |
| | | import org.springframework.beans.factory.annotation.Value |
| | | import org.springframework.stereotype.Service |
| | | import org.springframework.web.multipart.MultipartFile |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.awt.Image |
| | | import java.io.File |
| | | import java.time.LocalDate |
| | | import java.time.format.DateTimeFormatter |
| | | import java.util.* |
| | | import javax.imageio.ImageReader |
| | | import javax.imageio.stream.ImageInputStream |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | | /** |
| | |
| | | response.setIntHeader("totalPage", p.pages) |
| | | response.setIntHeader("currentPage", p.pageNum) |
| | | return result |
| | | } |
| | | |
| | | override fun getTemplateOfCommitment(userId: String): BaseResponse<CommitmentTemplate> { |
| | | TODO("Not yet implemented") |
| | | } |
| | | |
| | | override fun uploadLetterOfCommitment(userId: String, commitmentVoList: String, files: Array<MultipartFile>): Boolean { |
| | |
| | | SceneType.Construction.value, |
| | | SceneType.Wharf.value, |
| | | SceneType.StorageYard.value, |
| | | SceneType.MixingPlant.value, |
| | | SceneType.Industrial.value -> { |
| | | SceneType.MixingPlant.value -> { |
| | | templateName = "commitment-construction.ftl" |
| | | contractName = "commitment-construction-${now.time}.pdf" |
| | | } |
| | | SceneType.Industrial.value->{ |
| | | templateName = "commitment-industrial.ftl" |
| | | contractName = "commitment-industrial-${now.time}.pdf" |
| | | } |
| | | SceneType.VehicleRepair.value -> { |
| | | templateName = "commitment-vehicle.ftl" |
| | | contractName = "commitment-vehicle-${now.time}.pdf" |
| | | } |
| | | SceneType.Laboratory.value -> { |
| | | templateName = "commitment-laboratory.ftl" |
| | | contractName = "commitment-laboratory-${now.time}.pdf" |
| | | } |
| | | } |
| | | // val picName = contractName.replace("pdf", "jpg") |
| | | |