Compare commits
	
		
			2 Commits
		
	
	
		
			64bff26b84
			...
			b82f29335a
		
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								
								 | 
						b82f29335a | |
| 
							
							
								
								 | 
						7403872145 | 
| 
						 | 
				
			
			@ -45,10 +45,8 @@ import java.net.MalformedURLException;
 | 
			
		|||
import java.net.URL;
 | 
			
		||||
import java.text.ParseException;
 | 
			
		||||
import java.text.SimpleDateFormat;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Locale;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @Author:liang.chao
 | 
			
		||||
| 
						 | 
				
			
			@ -343,7 +341,7 @@ public class OrderController extends BaseController {
 | 
			
		|||
        bmContract.setStatus(1);
 | 
			
		||||
        List<BmContract> list = bmContractService.list(bmContract);
 | 
			
		||||
        String content = list.get(0).getContent();
 | 
			
		||||
        if (StringUtils.isBlank(content)){
 | 
			
		||||
        if (StringUtils.isBlank(content)) {
 | 
			
		||||
            content = bmContractService.lisTemplate(bmContract).get(0).getContent();
 | 
			
		||||
        }
 | 
			
		||||
        StrSubstitutor sub = new StrSubstitutor(replacements);
 | 
			
		||||
| 
						 | 
				
			
			@ -352,11 +350,12 @@ public class OrderController extends BaseController {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    @ApiOperation(value = "购物车协议(查看)")
 | 
			
		||||
    @GetMapping("/bookCarAgreement")
 | 
			
		||||
    public AjaxResult getbookCarAgreement(OrderInfoDto orderInfoDto, Map<String, Object> replacements) throws ParseException, IOException {
 | 
			
		||||
    @PostMapping("/bookCarAgreement")
 | 
			
		||||
    public AjaxResult getbookCarAgreement(@RequestBody OrderInfoDto orderInfoDto) throws ParseException {
 | 
			
		||||
        if (orderInfoDto != null) {
 | 
			
		||||
            SimpleDateFormat inputFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
 | 
			
		||||
            SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 | 
			
		||||
            Map<String, String> replacements = new HashMap<>();
 | 
			
		||||
            //装备所属公司
 | 
			
		||||
            replacements.put("czCompanyName", orderInfoDto.getCzcompanyName());
 | 
			
		||||
            //承租方所属公司
 | 
			
		||||
| 
						 | 
				
			
			@ -374,16 +373,19 @@ public class OrderController extends BaseController {
 | 
			
		|||
                orderDetail += "<p><br>机具名称:" + orderDetailDto.getDeviceName() + "<br>租期:" + beginTime + "至" + endTime + "<br>天数:" + orderDetailDto.getDays() + "天 <br>租金:" + orderDetailDto.getDayLeasePrice() + "元/天<br>数量:" + orderDetailDto.getNum() + "</p>";
 | 
			
		||||
            }
 | 
			
		||||
            replacements.put("orderTable", orderDetail);
 | 
			
		||||
 | 
			
		||||
            BmContract bmContract = new BmContract();
 | 
			
		||||
            bmContract.setStatus(1);
 | 
			
		||||
            List<BmContract> list = bmContractService.list(bmContract);
 | 
			
		||||
            String content = list.get(0).getContent();
 | 
			
		||||
            if (StringUtils.isBlank(content)) {
 | 
			
		||||
                content = bmContractService.lisTemplate(bmContract).get(0).getContent();
 | 
			
		||||
            }
 | 
			
		||||
            StrSubstitutor sub = new StrSubstitutor(replacements);
 | 
			
		||||
            String result = sub.replace(content);
 | 
			
		||||
            return AjaxResult.success(result);
 | 
			
		||||
        } else {
 | 
			
		||||
            return AjaxResult.error("参数错误");
 | 
			
		||||
        }
 | 
			
		||||
        BmContract bmContract = new BmContract();
 | 
			
		||||
        bmContract.setStatus(1);
 | 
			
		||||
        List<BmContract> list = bmContractService.list(bmContract);
 | 
			
		||||
        String content = list.get(0).getContent();
 | 
			
		||||
        if (StringUtils.isBlank(content)){
 | 
			
		||||
            content = bmContractService.lisTemplate(bmContract).get(0).getContent();
 | 
			
		||||
        }
 | 
			
		||||
        StrSubstitutor sub = new StrSubstitutor(replacements);
 | 
			
		||||
        String result = sub.replace(content);
 | 
			
		||||
        return AjaxResult.success(result);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue