Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
e376a34bf3
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,9 +78,8 @@ public class BmContractController extends BaseController {
|
||||||
@ApiOperation(value = "合同模板列表")
|
@ApiOperation(value = "合同模板列表")
|
||||||
@GetMapping("/lisTemplate")
|
@GetMapping("/lisTemplate")
|
||||||
public AjaxResult lisTemplate(BmContract bmContract) {
|
public AjaxResult lisTemplate(BmContract bmContract) {
|
||||||
startPage();
|
|
||||||
List<BmContract> list = bmContractService.lisTemplate(bmContract);
|
List<BmContract> list = bmContractService.lisTemplate(bmContract);
|
||||||
return AjaxResult.success(getDataTable(list));
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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("删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.material.reply.entity;
|
package com.bonus.material.reply.entity;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
@ -25,14 +26,19 @@ public class BmReply {
|
||||||
@ApiModelProperty(value = "创建人")
|
@ApiModelProperty(value = "创建人")
|
||||||
private Integer creater;
|
private Integer creater;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人所属公司")
|
||||||
|
private Integer replyCom;
|
||||||
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createrTime;
|
private Date createrTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "修改人")
|
@ApiModelProperty(value = "修改人")
|
||||||
private Integer updater;
|
private Integer updater;
|
||||||
|
|
||||||
@ApiModelProperty(value = "修改时间")
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
private Date updaterTime;
|
private Date updaterTime;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,18 +21,26 @@ public class ReplyServiceImpl implements ReplyService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BmReply> list(BmReply bmReply) {
|
public List<BmReply> list(BmReply bmReply) {
|
||||||
|
bmReply.setReplyCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
||||||
return replyMapper.list(bmReply);
|
return replyMapper.list(bmReply);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer add(BmReply bmReply) {
|
public Integer add(BmReply bmReply) {
|
||||||
bmReply.setCreater(SecurityUtils.getLoginUser().getUserid().intValue());
|
bmReply.setCreater(SecurityUtils.getLoginUser().getUserid().intValue());
|
||||||
|
bmReply.setReplyCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
|
||||||
return replyMapper.add(bmReply);
|
return replyMapper.add(bmReply);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer edit(BmReply bmReply) {
|
public Integer edit(BmReply bmReply) {
|
||||||
bmReply.setUpdater(SecurityUtils.getLoginUser().getUserid().intValue());
|
bmReply.setUpdater(SecurityUtils.getLoginUser().getUserid().intValue());
|
||||||
|
bmReply.setReplyCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().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>
|
||||||
|
|
@ -4,8 +4,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.bonus.material.reply.mapper.ReplyMapper">
|
<mapper namespace="com.bonus.material.reply.mapper.ReplyMapper">
|
||||||
<insert id="add" useGeneratedKeys="true" keyProperty="id">
|
<insert id="add" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into bm_reply(reply_title, reply_content, creater, creater_time)
|
insert into bm_reply(reply_title, reply_content, creater, creater_time, reply_com)
|
||||||
values(#{replyTitle}, #{replyContent}, #{creater}, now())
|
values(#{replyTitle}, #{replyContent}, #{creater}, now(), #{replyCom})
|
||||||
</insert>
|
</insert>
|
||||||
<update id="edit">
|
<update id="edit">
|
||||||
update bm_reply
|
update bm_reply
|
||||||
|
|
@ -19,10 +19,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updater != null">
|
<if test="updater != null">
|
||||||
updater = #{updater},
|
updater = #{updater},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="replyCom != null">
|
||||||
|
reply_com = #{replyCom},
|
||||||
|
</if>
|
||||||
updater_time = now()
|
updater_time = now()
|
||||||
</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
|
||||||
|
|
@ -46,6 +52,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
AND br.creater_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
AND br.creater_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="replyCom != null">
|
||||||
|
AND reply_com = #{replyCom},
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue