租赁协议
This commit is contained in:
		
							parent
							
								
									067192c825
								
							
						
					
					
						commit
						06df89cb22
					
				| 
						 | 
					@ -23,6 +23,10 @@
 | 
				
			||||||
            <artifactId>jasypt-spring-boot-starter</artifactId>
 | 
					            <artifactId>jasypt-spring-boot-starter</artifactId>
 | 
				
			||||||
            <version>${jasypt-spring-boot-starter.version}</version>
 | 
					            <version>${jasypt-spring-boot-starter.version}</version>
 | 
				
			||||||
        </dependency>
 | 
					        </dependency>
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>org.springframework</groupId>
 | 
				
			||||||
 | 
					            <artifactId>spring-test</artifactId>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
    	<!-- SpringCloud Alibaba Nacos -->
 | 
					    	<!-- SpringCloud Alibaba Nacos -->
 | 
				
			||||||
        <dependency>
 | 
					        <dependency>
 | 
				
			||||||
            <groupId>com.alibaba.cloud</groupId>
 | 
					            <groupId>com.alibaba.cloud</groupId>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -15,6 +15,8 @@ import com.bonus.material.order.domain.OrderDetailDto;
 | 
				
			||||||
import com.bonus.material.order.domain.OrderInfoDto;
 | 
					import com.bonus.material.order.domain.OrderInfoDto;
 | 
				
			||||||
import com.bonus.material.order.mapper.OrderMapper;
 | 
					import com.bonus.material.order.mapper.OrderMapper;
 | 
				
			||||||
import com.bonus.material.order.service.OrderService;
 | 
					import com.bonus.material.order.service.OrderService;
 | 
				
			||||||
 | 
					import com.bonus.system.api.RemoteFileService;
 | 
				
			||||||
 | 
					import com.bonus.system.api.domain.SysFile;
 | 
				
			||||||
import io.swagger.annotations.Api;
 | 
					import io.swagger.annotations.Api;
 | 
				
			||||||
import io.swagger.annotations.ApiOperation;
 | 
					import io.swagger.annotations.ApiOperation;
 | 
				
			||||||
import org.apache.commons.lang3.StringUtils;
 | 
					import org.apache.commons.lang3.StringUtils;
 | 
				
			||||||
| 
						 | 
					@ -23,6 +25,7 @@ import org.springframework.http.HttpHeaders;
 | 
				
			||||||
import org.springframework.http.HttpStatus;
 | 
					import org.springframework.http.HttpStatus;
 | 
				
			||||||
import org.springframework.http.MediaType;
 | 
					import org.springframework.http.MediaType;
 | 
				
			||||||
import org.springframework.http.ResponseEntity;
 | 
					import org.springframework.http.ResponseEntity;
 | 
				
			||||||
 | 
					import org.springframework.mock.web.MockMultipartFile;
 | 
				
			||||||
import org.springframework.web.bind.annotation.*;
 | 
					import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
import org.springframework.web.client.RestTemplate;
 | 
					import org.springframework.web.client.RestTemplate;
 | 
				
			||||||
import org.springframework.web.multipart.MultipartFile;
 | 
					import org.springframework.web.multipart.MultipartFile;
 | 
				
			||||||
| 
						 | 
					@ -58,6 +61,9 @@ public class OrderController extends BaseController {
 | 
				
			||||||
    @Resource
 | 
					    @Resource
 | 
				
			||||||
    private BmContractService bmContractService;
 | 
					    private BmContractService bmContractService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Resource
 | 
				
			||||||
 | 
					    private RemoteFileService sysFileService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 提交预约车到订单
 | 
					     * 提交预约车到订单
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
| 
						 | 
					@ -165,7 +171,7 @@ public class OrderController extends BaseController {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @ApiOperation(value = "租赁协议(查看)")
 | 
					    @ApiOperation(value = "租赁协议(查看)")
 | 
				
			||||||
    @GetMapping("/leaseAgreement")
 | 
					    @GetMapping("/leaseAgreement")
 | 
				
			||||||
    public ResponseEntity<byte[]> getleaseAgreement(String orderId, Map<String, String> replacements) throws IOException {
 | 
					    public AjaxResult getleaseAgreement(String orderId, Map<String, String> replacements) throws IOException {
 | 
				
			||||||
        OrderInfoDto orderInfoDto = orderService.getAgreementByOrderId(orderId);
 | 
					        OrderInfoDto orderInfoDto = orderService.getAgreementByOrderId(orderId);
 | 
				
			||||||
        BmContract bmContract = new BmContract();
 | 
					        BmContract bmContract = new BmContract();
 | 
				
			||||||
        bmContract.setStatus(1);
 | 
					        bmContract.setStatus(1);
 | 
				
			||||||
| 
						 | 
					@ -202,6 +208,7 @@ public class OrderController extends BaseController {
 | 
				
			||||||
        document.write(outputStream);
 | 
					        document.write(outputStream);
 | 
				
			||||||
        byte[] wordBytes = outputStream.toByteArray();
 | 
					        byte[] wordBytes = outputStream.toByteArray();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Convert Word to Image (simple example using BufferedImage)
 | 
					        // Convert Word to Image (simple example using BufferedImage)
 | 
				
			||||||
/*        BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
 | 
					/*        BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
 | 
				
			||||||
        Graphics2D graphics = image.createGraphics();
 | 
					        Graphics2D graphics = image.createGraphics();
 | 
				
			||||||
| 
						 | 
					@ -210,12 +217,14 @@ public class OrderController extends BaseController {
 | 
				
			||||||
        graphics.setPaint(Color.black);
 | 
					        graphics.setPaint(Color.black);
 | 
				
			||||||
        graphics.drawString(new String(wordBytes), 10, 20);
 | 
					        graphics.drawString(new String(wordBytes), 10, 20);
 | 
				
			||||||
        graphics.dispose();*/
 | 
					        graphics.dispose();*/
 | 
				
			||||||
 | 
					        MultipartFile file = new MockMultipartFile("contract", "contract.docx", MediaType.APPLICATION_OCTET_STREAM_VALUE, wordBytes);
 | 
				
			||||||
        HttpHeaders headers = new HttpHeaders();
 | 
					        AjaxResult upload = sysFileService.upload(file);
 | 
				
			||||||
        headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
 | 
					        return upload;
 | 
				
			||||||
        headers.setContentDispositionFormData("attachment", "contract.docx");
 | 
					//        HttpHeaders headers = new HttpHeaders();
 | 
				
			||||||
        return ResponseEntity.ok()
 | 
					//        headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
 | 
				
			||||||
                .headers(headers)
 | 
					//        headers.setContentDispositionFormData("attachment", "contract.docx");
 | 
				
			||||||
                .body(wordBytes);
 | 
					//        return ResponseEntity.ok()
 | 
				
			||||||
 | 
					//                .headers(headers)
 | 
				
			||||||
 | 
					//                .body(wordBytes);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue