代码提交
This commit is contained in:
		
							parent
							
								
									c01ed44303
								
							
						
					
					
						commit
						f3e57f60c3
					
				| 
						 | 
					@ -6,6 +6,8 @@ import com.bonus.common.core.web.page.TableDataInfo;
 | 
				
			||||||
import com.bonus.material.book.domain.BookCarDetailDto;
 | 
					import com.bonus.material.book.domain.BookCarDetailDto;
 | 
				
			||||||
import com.bonus.material.book.domain.BookCarInfoDto;
 | 
					import com.bonus.material.book.domain.BookCarInfoDto;
 | 
				
			||||||
import com.bonus.material.book.service.BookCarService;
 | 
					import com.bonus.material.book.service.BookCarService;
 | 
				
			||||||
 | 
					import com.bonus.material.contract.domain.BmContract;
 | 
				
			||||||
 | 
					import com.bonus.material.contract.service.BmContractService;
 | 
				
			||||||
import com.bonus.material.device.domain.vo.DevInfoVo;
 | 
					import com.bonus.material.device.domain.vo.DevInfoVo;
 | 
				
			||||||
import io.swagger.annotations.Api;
 | 
					import io.swagger.annotations.Api;
 | 
				
			||||||
import io.swagger.annotations.ApiOperation;
 | 
					import io.swagger.annotations.ApiOperation;
 | 
				
			||||||
| 
						 | 
					@ -26,6 +28,9 @@ public class BookCarController extends BaseController {
 | 
				
			||||||
    @Resource
 | 
					    @Resource
 | 
				
			||||||
    private BookCarService bookCarService;
 | 
					    private BookCarService bookCarService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Resource
 | 
				
			||||||
 | 
					    private BmContractService bmContractService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 添加预约车
 | 
					     * 添加预约车
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
| 
						 | 
					@ -64,4 +69,12 @@ public class BookCarController extends BaseController {
 | 
				
			||||||
        return bookCarService.getBookCarDetailByMaId(devInfo);
 | 
					        return bookCarService.getBookCarDetailByMaId(devInfo);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiOperation(value = "购物车免责声明")
 | 
				
			||||||
 | 
					    @GetMapping("/disclaimer")
 | 
				
			||||||
 | 
					    public AjaxResult disclaimer() {
 | 
				
			||||||
 | 
					        BmContract bmContract = bmContractService.disclaimer();
 | 
				
			||||||
 | 
					        return AjaxResult.success(bmContract);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,4 +27,6 @@ public interface BmContractMapper {
 | 
				
			||||||
    Integer updateStatusOther(BmContract bmContract);
 | 
					    Integer updateStatusOther(BmContract bmContract);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    List<BmContract> lisTemplate(BmContract bmContract);
 | 
					    List<BmContract> lisTemplate(BmContract bmContract);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    BmContract disclaimer();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,4 +22,6 @@ public interface BmContractService {
 | 
				
			||||||
    Integer updateStatus(BmContract bmContract);
 | 
					    Integer updateStatus(BmContract bmContract);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    List<BmContract> lisTemplate(BmContract bmContract);
 | 
					    List<BmContract> lisTemplate(BmContract bmContract);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    BmContract disclaimer();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -120,6 +120,11 @@ public class BmContractServiceImpl implements BmContractService {
 | 
				
			||||||
        return bmContractMapper.lisTemplate(bmContract);
 | 
					        return bmContractMapper.lisTemplate(bmContract);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public BmContract disclaimer() {
 | 
				
			||||||
 | 
					        return bmContractMapper.disclaimer();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private String getString() {
 | 
					    private String getString() {
 | 
				
			||||||
        //根据前台传过来的数据,生成需求编号
 | 
					        //根据前台传过来的数据,生成需求编号
 | 
				
			||||||
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
 | 
					        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,6 +20,7 @@ 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;
 | 
				
			||||||
 | 
					import org.apache.commons.lang3.text.StrSubstitutor;
 | 
				
			||||||
import org.apache.poi.xwpf.usermodel.*;
 | 
					import org.apache.poi.xwpf.usermodel.*;
 | 
				
			||||||
import org.springframework.http.HttpHeaders;
 | 
					import org.springframework.http.HttpHeaders;
 | 
				
			||||||
import org.springframework.http.HttpStatus;
 | 
					import org.springframework.http.HttpStatus;
 | 
				
			||||||
| 
						 | 
					@ -173,7 +174,7 @@ public class OrderController extends BaseController {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @ApiOperation(value = "租赁协议(查看)")
 | 
					    /*@ApiOperation(value = "租赁协议(查看)")
 | 
				
			||||||
    @GetMapping("/leaseAgreement")
 | 
					    @GetMapping("/leaseAgreement")
 | 
				
			||||||
    public AjaxResult getleaseAgreement(String orderId, Map<String, String> replacements) throws IOException, ParseException {
 | 
					    public AjaxResult getleaseAgreement(String orderId, Map<String, String> replacements) throws IOException, ParseException {
 | 
				
			||||||
        OrderInfoDto orderInfoDto = orderService.getAgreementByOrderId(orderId);
 | 
					        OrderInfoDto orderInfoDto = orderService.getAgreementByOrderId(orderId);
 | 
				
			||||||
| 
						 | 
					@ -220,5 +221,41 @@ public class OrderController extends BaseController {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        MultipartFile file = new MockMultipartFile("contract", "contract.docx", MediaType.APPLICATION_OCTET_STREAM_VALUE, wordBytes);
 | 
					        MultipartFile file = new MockMultipartFile("contract", "contract.docx", MediaType.APPLICATION_OCTET_STREAM_VALUE, wordBytes);
 | 
				
			||||||
        return sysFileService.upload(file);
 | 
					        return sysFileService.upload(file);
 | 
				
			||||||
 | 
					    }*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @ApiOperation(value = "租赁协议(查看)")
 | 
				
			||||||
 | 
					    @GetMapping("/leaseAgreement")
 | 
				
			||||||
 | 
					    public AjaxResult getleaseAgreement(String orderId, Map<String, Object> replacements) throws ParseException {
 | 
				
			||||||
 | 
					        OrderInfoDto orderInfoDto = orderService.getAgreementByOrderId(orderId);
 | 
				
			||||||
 | 
					        List<OrderDetailDto> orderDetailsByOrderId = orderMapper.selectOrderDetailsByOderId(orderId);
 | 
				
			||||||
 | 
					        String dateStr = orderInfoDto.getOrderTime().toString();
 | 
				
			||||||
 | 
					        SimpleDateFormat inputFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.ENGLISH);
 | 
				
			||||||
 | 
					        SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Date date = inputFormat.parse(dateStr);
 | 
				
			||||||
 | 
					        String formattedDate = outputFormat.format(date);
 | 
				
			||||||
 | 
					        //订单日期
 | 
				
			||||||
 | 
					        replacements.put("${orderTime}", formattedDate);
 | 
				
			||||||
 | 
					        //装备所属公司
 | 
				
			||||||
 | 
					        replacements.put("${czcompanyName}", orderInfoDto.getCzcompanyName());
 | 
				
			||||||
 | 
					        //承租方所属公司
 | 
				
			||||||
 | 
					        replacements.put("${companyName}", orderInfoDto.getCompanyName());
 | 
				
			||||||
 | 
					        //订单金额
 | 
				
			||||||
 | 
					        replacements.put("${cost}", orderInfoDto.getCost().toString());
 | 
				
			||||||
 | 
					        //订单详情
 | 
				
			||||||
 | 
					        String orderDetail = "";
 | 
				
			||||||
 | 
					        for (OrderDetailDto orderDetailDto : orderDetailsByOrderId) {
 | 
				
			||||||
 | 
					            orderDetail += "<p>机具名称:" + orderDetailDto.getDeviceName() + "  租期:" + orderDetailDto.getRentBeginTime() + "至" + orderDetailDto.getRentEndTime() + "  天数:" + orderDetailDto.getDays() + "天  租金:" + orderDetailDto.getDayLeasePrice() + "元/天  数量:" + 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();
 | 
				
			||||||
 | 
					        StrSubstitutor sub = new StrSubstitutor(replacements);
 | 
				
			||||||
 | 
					        String result = sub.replace(content);
 | 
				
			||||||
 | 
					        return AjaxResult.success(result);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,4 +52,15 @@ public class ReplyController extends BaseController {
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @PostMapping("/del")
 | 
				
			||||||
 | 
					    @ApiOperation("删除快捷回复")
 | 
				
			||||||
 | 
					    public AjaxResult del(@RequestBody BmReply bmReply) {
 | 
				
			||||||
 | 
					        Integer i = replyService.del(bmReply);
 | 
				
			||||||
 | 
					        if (i > 0) {
 | 
				
			||||||
 | 
					            return AjaxResult.success("删除成功");
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            return AjaxResult.error("删除失败");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -14,4 +14,6 @@ public interface ReplyMapper {
 | 
				
			||||||
    Integer add(BmReply bmReply);
 | 
					    Integer add(BmReply bmReply);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Integer edit(BmReply bmReply);
 | 
					    Integer edit(BmReply bmReply);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Integer del(BmReply bmReply);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -14,4 +14,6 @@ public interface ReplyService {
 | 
				
			||||||
    Integer add(BmReply bmReply);
 | 
					    Integer add(BmReply bmReply);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Integer edit(BmReply bmReply);
 | 
					    Integer edit(BmReply bmReply);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Integer del(BmReply bmReply);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,4 +35,9 @@ public class ReplyServiceImpl implements ReplyService {
 | 
				
			||||||
        bmReply.setUpdater(SecurityUtils.getLoginUser().getUserid().intValue());
 | 
					        bmReply.setUpdater(SecurityUtils.getLoginUser().getUserid().intValue());
 | 
				
			||||||
        return replyMapper.edit(bmReply);
 | 
					        return replyMapper.edit(bmReply);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public Integer del(BmReply bmReply) {
 | 
				
			||||||
 | 
					        return replyMapper.del(bmReply);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,4 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			||||||
    <select id="lisTemplate" resultType="com.bonus.material.contract.domain.BmContract">
 | 
					    <select id="lisTemplate" resultType="com.bonus.material.contract.domain.BmContract">
 | 
				
			||||||
        select * from bm_contract_template where type = 0
 | 
					        select * from bm_contract_template where type = 0
 | 
				
			||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
 | 
					    <select id="disclaimer" resultType="com.bonus.material.contract.domain.BmContract">
 | 
				
			||||||
 | 
					        select content from bm_book_contract limit 1
 | 
				
			||||||
 | 
					    </select>
 | 
				
			||||||
</mapper>
 | 
					</mapper>
 | 
				
			||||||
| 
						 | 
					@ -23,6 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
				
			||||||
        </set>
 | 
					        </set>
 | 
				
			||||||
        where id = #{id}
 | 
					        where id = #{id}
 | 
				
			||||||
    </update>
 | 
					    </update>
 | 
				
			||||||
 | 
					    <delete id="del">
 | 
				
			||||||
 | 
					        delete from bm_reply where id = #{id}
 | 
				
			||||||
 | 
					    </delete>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <select id="list" resultType="com.bonus.material.reply.entity.BmReply">
 | 
					    <select id="list" resultType="com.bonus.material.reply.entity.BmReply">
 | 
				
			||||||
        select
 | 
					        select
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue