Commit f7e4963b authored by hanfeng's avatar hanfeng

Merge remote-tracking branch 'origin/dev' into dev

parents 1f8c1ee2 965dab3d
...@@ -25,7 +25,7 @@ import static org.springframework.http.HttpStatus.NOT_EXTENDED; ...@@ -25,7 +25,7 @@ import static org.springframework.http.HttpStatus.NOT_EXTENDED;
/** /**
* Created by ace on 2017/9/8. * Created by ace on 2017/9/8.
*/ */
@ControllerAdvice @ControllerAdvice("com.github.wxiaoqi.security")
@ResponseBody @ResponseBody
public class GlobalExceptionHandler extends ResponseEntityExceptionHandler { public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
private Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class); private Logger logger = LoggerFactory.getLogger(GlobalExceptionHandler.class);
...@@ -67,7 +67,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler { ...@@ -67,7 +67,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
if(0 == ex.getStatus()) { if(0 == ex.getStatus()) {
response.setStatus(500); response.setStatus(500);
} }
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + ex.toString()); HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + ex);
return new BaseResponse(ex.getStatus(), ex.getMessage()); return new BaseResponse(ex.getStatus(), ex.getMessage());
} }
...@@ -75,7 +75,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler { ...@@ -75,7 +75,7 @@ public class GlobalExceptionHandler extends ResponseEntityExceptionHandler {
public BaseResponse otherExceptionHandler(HttpServletResponse response, Exception ex) { public BaseResponse otherExceptionHandler(HttpServletResponse response, Exception ex) {
response.setStatus(500); response.setStatus(500);
logger.error(ex.getMessage(),ex); logger.error(ex.getMessage(),ex);
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + ex.toString()); HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + ex);
return new BaseResponse(CommonConstants.EX_OTHER_CODE, ex.getMessage()); return new BaseResponse(CommonConstants.EX_OTHER_CODE, ex.getMessage());
} }
} }
...@@ -4,6 +4,7 @@ package com.github.wxiaoqi.security.common.handler; ...@@ -4,6 +4,7 @@ package com.github.wxiaoqi.security.common.handler;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.BaseResponse; import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
...@@ -28,9 +29,11 @@ public class PlatformExceptionHandler { ...@@ -28,9 +29,11 @@ public class PlatformExceptionHandler {
Throwable cause = e.getCause(); Throwable cause = e.getCause();
if(cause != null && cause.toString().contains("Exception")) { if(cause != null && cause.toString().contains("Exception")) {
log.error(cause.getMessage(), e); log.error(cause.getMessage(), e);
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + e);
return assembleResult(ObjectRestResponse.createFailedResult(5000, "服务器开小差了,请稍后重试!"), "Server exception: " + e.getMessage()); return assembleResult(ObjectRestResponse.createFailedResult(5000, "服务器开小差了,请稍后重试!"), "Server exception: " + e.getMessage());
} }
log.error("Server exception: ", e); log.error("Server exception: ", e);
HttpRequestUtil.httpGet("http://10.5.52.3:8765/api/universal/mail/app/unauth/send?toUser=jiaoruizhen@126.com&subject=服务器异常&content=" + e);
return assembleResult(ObjectRestResponse.createFailedResult(5000, "服务器开小差了,请稍后重试!"), "Server exception: " + e.getMessage()); return assembleResult(ObjectRestResponse.createFailedResult(5000, "服务器开小差了,请稍后重试!"), "Server exception: " + e.getMessage());
} }
......
...@@ -56,7 +56,6 @@ public class TokenAop { ...@@ -56,7 +56,6 @@ public class TokenAop {
public Object token(ProceedingJoinPoint proceedingJoinPoint) throws Throwable{ public Object token(ProceedingJoinPoint proceedingJoinPoint) throws Throwable{
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
String token = request.getHeader(tokenHeader); String token = request.getHeader(tokenHeader);
log.info("token【{}】",token);
Object[] args = proceedingJoinPoint.getArgs(); Object[] args = proceedingJoinPoint.getArgs();
if (ArrayUtil.isEmpty(args)){ if (ArrayUtil.isEmpty(args)){
//没有参数直接返回 //没有参数直接返回
......
...@@ -3,29 +3,22 @@ package com.github.wxiaoqi.security.admin.rest; ...@@ -3,29 +3,22 @@ package com.github.wxiaoqi.security.admin.rest;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.github.wxiaoqi.security.admin.biz.*; import com.github.wxiaoqi.security.admin.biz.*;
import com.github.wxiaoqi.security.admin.entity.*; import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.AppUserPosition;
import com.github.wxiaoqi.security.admin.entity.User;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO; import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.admin.rpc.service.PermissionService;
import com.github.wxiaoqi.security.admin.vo.AppUserVo; import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.admin.vo.FrontUser;
import com.github.wxiaoqi.security.admin.vo.MenuTree;
import com.github.wxiaoqi.security.admin.vo.UserMemberVo; import com.github.wxiaoqi.security.admin.vo.UserMemberVo;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken;
import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil; import com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.BaseResponse;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse; import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode; import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import io.swagger.models.auth.In;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.*; import java.util.ArrayList;
import java.util.List;
/** /**
* ${DESCRIPTION} * ${DESCRIPTION}
...@@ -60,11 +53,11 @@ public class PublicController { ...@@ -60,11 +53,11 @@ public class PublicController {
ObjectRestResponse userinfoByToken(String token) throws Exception { ObjectRestResponse userinfoByToken(String token) throws Exception {
String username = userAuthUtil.getInfoFromToken(token).getUniqueName(); String username = userAuthUtil.getInfoFromToken(token).getUniqueName();
if (username == null) { if (username == null) {
throw new BaseException(ResultCode.NOTEXIST_CODE); return ObjectRestResponse.createFailedResult(ResultCode.USER_NOTEXIST_CODE, ResultCode.getMsg(ResultCode.USER_NOTEXIST_CODE));
} }
User user = userBiz.getUserByUsername(username); User user = userBiz.getUserByUsername(username);
if (user == null) { if (user == null) {
throw new BaseException(ResultCode.NOTEXIST_CODE); return ObjectRestResponse.createFailedResult(ResultCode.USER_NOTEXIST_CODE, ResultCode.getMsg(ResultCode.USER_NOTEXIST_CODE));
} }
return new ObjectRestResponse<User>().rel(true).data(user); return new ObjectRestResponse<User>().rel(true).data(user);
} }
...@@ -74,8 +67,7 @@ public class PublicController { ...@@ -74,8 +67,7 @@ public class PublicController {
ObjectRestResponse userDetailByToken(String token) throws Exception { ObjectRestResponse userDetailByToken(String token) throws Exception {
String username = userAuthUtil.getInfoFromToken(token).getId(); String username = userAuthUtil.getInfoFromToken(token).getId();
if (username == null) { if (username == null) {
throw new BaseException(ResultCode.NOTEXIST_CODE return ObjectRestResponse.createFailedResult(ResultCode.USER_NOTEXIST_CODE, ResultCode.getMsg(ResultCode.USER_NOTEXIST_CODE));
, new HashSet<String>() {{add("用户名不存在!");}});
} }
Integer userid = Integer.parseInt(username); Integer userid = Integer.parseInt(username);
return ObjectRestResponse.succ(getAppUserInfoById(userid)); return ObjectRestResponse.succ(getAppUserInfoById(userid));
...@@ -85,8 +77,7 @@ public class PublicController { ...@@ -85,8 +77,7 @@ public class PublicController {
public @ResponseBody public @ResponseBody
ObjectRestResponse<AppUserDTO> userDetailById(Integer id) throws Exception { ObjectRestResponse<AppUserDTO> userDetailById(Integer id) throws Exception {
if (id == null) { if (id == null) {
throw new BaseException(ResultCode.NOTEXIST_CODE return ObjectRestResponse.paramIsEmpty();
, new HashSet<String>() {{add("用户名不存在!");}});
} }
return ObjectRestResponse.succ(getAppUserInfoById(id)); return ObjectRestResponse.succ(getAppUserInfoById(id));
} }
...@@ -96,13 +87,11 @@ public class PublicController { ...@@ -96,13 +87,11 @@ public class PublicController {
ObjectRestResponse<AppUserDTO> userDetailByUsername(String name) throws Exception { ObjectRestResponse<AppUserDTO> userDetailByUsername(String name) throws Exception {
AppUserLogin appUserLogin; AppUserLogin appUserLogin;
if (StrUtil.isBlank(name)) { if (StrUtil.isBlank(name)) {
throw new BaseException(ResultCode.NOTEXIST_CODE return ObjectRestResponse.paramIsEmpty();
, new HashSet<String>() {{add("用户名不存在!");}});
}else { }else {
appUserLogin = appUserLoginBiz.selectOne(new AppUserLogin(){{setUsername(name);}}); appUserLogin = appUserLoginBiz.selectOne(new AppUserLogin(){{setUsername(name);}});
if(null == appUserLogin) { if(null == appUserLogin) {
throw new BaseException(ResultCode.NOTEXIST_CODE return ObjectRestResponse.createFailedResult(ResultCode.USER_NOTEXIST_CODE, ResultCode.getMsg(ResultCode.USER_NOTEXIST_CODE));
, new HashSet<String>() {{add("用户名不存在!");}});
} }
} }
return ObjectRestResponse.succ(getAppUserInfoById(appUserLogin.getId())); return ObjectRestResponse.succ(getAppUserInfoById(appUserLogin.getId()));
...@@ -113,8 +102,7 @@ public class PublicController { ...@@ -113,8 +102,7 @@ public class PublicController {
//获取用户基础信息 //获取用户基础信息
AppUserVo userVo = detailBiz.getUserInfoById(userid); AppUserVo userVo = detailBiz.getUserInfoById(userid);
if (userVo == null) { if (userVo == null) {
throw new BaseException(ResultCode.NOTEXIST_CODE return null;
, new HashSet<String>() {{add("用户不存在!");}});
} }
Integer id= userVo.getId(); Integer id= userVo.getId();
Integer positionId=userVo.getPositionId(); Integer positionId=userVo.getPositionId();
...@@ -136,15 +124,15 @@ public class PublicController { ...@@ -136,15 +124,15 @@ public class PublicController {
@RequestMapping(value = "/userinfo-by-uid", method = RequestMethod.GET) @RequestMapping(value = "/userinfo-by-uid", method = RequestMethod.GET)
public @ResponseBody public @ResponseBody
ObjectRestResponse userinfoByUid(Integer uid) throws Exception { ObjectRestResponse<User> userinfoByUid(Integer uid) throws Exception {
if (uid == null||uid==0) { if (uid == null||uid==0) {
throw new BaseException(); return ObjectRestResponse.paramIsEmpty();
} }
User user = userBiz.getUserByUid(uid); User user = userBiz.getUserByUid(uid);
if (user == null) { if (user == null) {
throw new BaseException(); return ObjectRestResponse.createFailedResult(ResultCode.USER_NOTEXIST_CODE, ResultCode.getMsg(ResultCode.USER_NOTEXIST_CODE));
} }
return new ObjectRestResponse<User>().rel(true).data(user); return ObjectRestResponse.succ(user);
} }
@GetMapping("/getByUserIds") @GetMapping("/getByUserIds")
......
...@@ -77,7 +77,7 @@ public class MsgBiz { ...@@ -77,7 +77,7 @@ public class MsgBiz {
Query query = null; Query query = null;
List<Msg> msgList = null; List<Msg> msgList = null;
if (type != null) { if (type != null) {
query = new Query(Criteria.where("body.type").is(type)); query = new Query(Criteria.where("body.type").is(type).and("visible").is(1));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size(); int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable); query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "time")); query.with(new Sort(Sort.Direction.DESC, "time"));
...@@ -89,7 +89,7 @@ public class MsgBiz { ...@@ -89,7 +89,7 @@ public class MsgBiz {
List<Integer> ids = new ArrayList<>(); List<Integer> ids = new ArrayList<>();
ids.add(2); ids.add(2);
ids.add(4); ids.add(4);
query = new Query(Criteria.where("body.type").in(ids)); query = new Query(Criteria.where("body.type").in(ids).and("visible").is(1));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size(); int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable); query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "time")); query.with(new Sort(Sort.Direction.DESC, "time"));
...@@ -114,7 +114,7 @@ public class MsgBiz { ...@@ -114,7 +114,7 @@ public class MsgBiz {
List<Integer> ids = new ArrayList<>(); List<Integer> ids = new ArrayList<>();
ids.add(2); ids.add(2);
ids.add(4); ids.add(4);
Query query = new Query(Criteria.where("body.type").in(ids).and("count.praise").gt(getNumber())); Query query = new Query(Criteria.where("body.type").in(ids).and("count.praise").gt(getNumber()).and("visible").is(1));
int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size(); int totalSize = mongoTemplate.find(query, Msg.class, "s_msg").size();
query.with(pageable); query.with(pageable);
query.with(new Sort(Sort.Direction.DESC, "count.praise")); query.with(new Sort(Sort.Direction.DESC, "count.praise"));
...@@ -134,7 +134,7 @@ public class MsgBiz { ...@@ -134,7 +134,7 @@ public class MsgBiz {
if (id == null) { if (id == null) {
return ObjectRestResponse.paramIsEmpty(); return ObjectRestResponse.paramIsEmpty();
} }
Query query = new Query(Criteria.where("id").is(new ObjectId(id))); Query query = new Query(Criteria.where("id").is(new ObjectId(id)).and("visible").is(1));
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId); List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
List<MsgVo> msgVoList = replaceMsgResult(msgList); List<MsgVo> msgVoList = replaceMsgResult(msgList);
if (msgVoList.size() > 0) { if (msgVoList.size() > 0) {
......
...@@ -81,4 +81,9 @@ public class InProgressVO { ...@@ -81,4 +81,9 @@ public class InProgressVO {
* 延期 详情列表 * 延期 详情列表
*/ */
List<VMCalendarPriceCostDTO> overAmountList = CollUtil.newArrayList(); List<VMCalendarPriceCostDTO> overAmountList = CollUtil.newArrayList();
/**
* 违约金 费用详情列表
*/
List<VMCalendarPriceCostDTO> violateAmountList = CollUtil.newArrayList();
} }
package com.xxfc.platform.order.pojo.price; package com.xxfc.platform.order.pojo.price;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.xxfc.platform.order.pojo.account.OrderAccountDeduction;
import com.xxfc.platform.vehicle.pojo.dto.order.VMCalendarPriceCostDTO; import com.xxfc.platform.vehicle.pojo.dto.order.VMCalendarPriceCostDTO;
import lombok.Data; import lombok.Data;
...@@ -24,6 +25,11 @@ public class CancelStartedVO extends CostDetailExtend { ...@@ -24,6 +25,11 @@ public class CancelStartedVO extends CostDetailExtend {
*/ */
private Integer usedDayNum = 0; private Integer usedDayNum = 0;
/**
* 允许使用天数
*/
private Integer ableUsedDayNum = 0;
/** /**
* 使用金额 * 使用金额
*/ */
...@@ -69,34 +75,17 @@ public class CancelStartedVO extends CostDetailExtend { ...@@ -69,34 +75,17 @@ public class CancelStartedVO extends CostDetailExtend {
*/ */
private BigDecimal damagesAmount = BigDecimal.ZERO; private BigDecimal damagesAmount = BigDecimal.ZERO;
private List<OrderAccountDeduction> deductionList = CollUtil.newArrayList();
/** /**
* 延期 详情列表 * 延期 详情列表
*/ */
List<VMCalendarPriceCostDTO> overAmountList = CollUtil.newArrayList(); List<VMCalendarPriceCostDTO> overAmountList = CollUtil.newArrayList();
//标记是否单价一样
private Integer sameUseUnitPrice = 1;
//标记是否单价一样 //标记是否单价一样
private Integer sameOverUnitPrice = 1; private Integer sameOverUnitPrice = 1;
public void setSameUseUnitPriceFromList(List<VMCalendarPriceCostDTO> useAmountList) {
this.sameUseUnitPrice = judgeSame(useAmountList);
}
public void setSameOverUnitPriceFromList(List<VMCalendarPriceCostDTO> overAmountList) { public void setSameOverUnitPriceFromList(List<VMCalendarPriceCostDTO> overAmountList) {
this.sameOverUnitPrice = judgeSame(overAmountList); this.sameOverUnitPrice = judgeSame(overAmountList);
} }
private Integer judgeSame(List<VMCalendarPriceCostDTO> useAmountList) {
BigDecimal tempUnitPrice = null;
for(VMCalendarPriceCostDTO vmcpcd : useAmountList) {
if(null == tempUnitPrice) {
tempUnitPrice = vmcpcd.getPrice();
}else if(!tempUnitPrice.equals(vmcpcd.getPrice())) {
return 0;
}
}
return 1;
}
} }
...@@ -42,7 +42,38 @@ public class CostDetailExtend { ...@@ -42,7 +42,38 @@ public class CostDetailExtend {
/** /**
* 使用(消耗)详情列表 * 使用(消耗)详情列表
*/ */
List<VMCalendarPriceCostDTO> useAmountList = CollUtil.newArrayList();; List<VMCalendarPriceCostDTO> useAmountList = CollUtil.newArrayList();
/**
* 违约金 费用详情列表
*/
List<VMCalendarPriceCostDTO> violateAmountList = CollUtil.newArrayList();
//标记是否单价一样
private Integer sameUseUnitPrice = 1;
//标记是否单价一样
private Integer sameViolateUnitPrice = 1;
public void setSameUseUnitPriceFromList(List<VMCalendarPriceCostDTO> useAmountList) {
this.sameUseUnitPrice = judgeSame(useAmountList);
}
public void setSameViolateUnitPriceFromList(List<VMCalendarPriceCostDTO> violateAmountList) {
this.sameViolateUnitPrice = judgeSame(violateAmountList);
}
protected Integer judgeSame(List<VMCalendarPriceCostDTO> useAmountList) {
BigDecimal tempUnitPrice = null;
for(VMCalendarPriceCostDTO vmcpcd : useAmountList) {
if(null == tempUnitPrice) {
tempUnitPrice = vmcpcd.getPrice();
}else if(!tempUnitPrice.equals(vmcpcd.getPrice())) {
return 0;
}
}
return 1;
}
public void initParamJson() { public void initParamJson() {
paramJson = JSONUtil.toJsonStr(this); paramJson = JSONUtil.toJsonStr(this);
......
...@@ -483,10 +483,13 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -483,10 +483,13 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
csv.setUsedfreeDayNum(inProgressVO.getUsedfreeDays()); csv.setUsedfreeDayNum(inProgressVO.getUsedfreeDays());
csv.setUsedFreeAmount(inProgressVO.getUsedFreeDaysAmount()); csv.setUsedFreeAmount(inProgressVO.getUsedFreeDaysAmount());
csv.setHadConpon((StrUtil.isNotBlank(orderMQDTO.getCouponTickerNos())? Boolean.TRUE: Boolean.FALSE)); csv.setHadConpon((StrUtil.isNotBlank(orderMQDTO.getCouponTickerNos())? Boolean.TRUE: Boolean.FALSE));
csv.setAbleUsedDayNum(inProgressVO.getUseAmountList().size());
csv.setSameUseUnitPriceFromList(inProgressVO.getUseAmountList()); csv.setSameUseUnitPriceFromList(inProgressVO.getUseAmountList());
csv.setSameOverUnitPriceFromList(inProgressVO.getOverAmountList()); csv.setSameOverUnitPriceFromList(inProgressVO.getOverAmountList());
csv.setUseAmountList(inProgressVO.getUseAmountList()); csv.setUseAmountList(inProgressVO.getUseAmountList());
csv.setOverAmountList(inProgressVO.getOverAmountList()); csv.setOverAmountList(inProgressVO.getOverAmountList());
csv.setViolateAmountList(inProgressVO.getViolateAmountList());
if(csv.getUsedDayNum() == orderMQDTO.getOrderRentVehicleDetail().getDayNum()) { if(csv.getUsedDayNum() == orderMQDTO.getOrderRentVehicleDetail().getDayNum()) {
csv.setType(CostDetailExtend.FINLISH_ONTIME); csv.setType(CostDetailExtend.FINLISH_ONTIME);
...@@ -499,6 +502,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -499,6 +502,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
} }
csv.setDeductionList(oad.getDeductions());
csv.initParamJson(); csv.initParamJson();
//设置明细 //设置明细
orderRentVehicleBiz.updateSelectiveByIdRe(new OrderRentVehicleDetail(){{ orderRentVehicleBiz.updateSelectiveByIdRe(new OrderRentVehicleDetail(){{
......
...@@ -161,8 +161,13 @@ public class OrderDepositRefundRecordBiz extends BaseBiz<DepositRefundRecordMapp ...@@ -161,8 +161,13 @@ public class OrderDepositRefundRecordBiz extends BaseBiz<DepositRefundRecordMapp
if(depositRefundRecord != null) { if(depositRefundRecord != null) {
DepositRefundRecord newValue = new DepositRefundRecord(); DepositRefundRecord newValue = new DepositRefundRecord();
BeanUtil.copyProperties(depositRefundRecord, newValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true)); BeanUtil.copyProperties(depositRefundRecord, newValue, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
newValue.setAmount(orderViolation.getPrice()); if (orderViolation.getPrice().doubleValue() > 0) {
newValue.setRestAmount(depositRefundRecord.getTotalAmount().subtract(orderViolation.getPrice()));//减去违章金之后的押金 newValue.setAmount(orderViolation.getPrice());
newValue.setRestAmount(depositRefundRecord.getRestAmount().subtract(orderViolation.getPrice()));//减去违章金之后的押金
} else {
newValue.setAmount(new BigDecimal(0));
newValue.setRestAmount(depositRefundRecord.getRestAmount());//减去违章金之后的押金
}
newValue.setIscomplete(false); newValue.setIscomplete(false);
newValue.setId(null); newValue.setId(null);
mapper.insert(newValue); mapper.insert(newValue);
......
...@@ -207,16 +207,21 @@ public class OrderCalculateBiz { ...@@ -207,16 +207,21 @@ public class OrderCalculateBiz {
BigDecimal residueAmount = BigDecimal.ZERO; BigDecimal residueAmount = BigDecimal.ZERO;
for(int i = useDays; i < vehicleItemDTO.getTotalNum(); i++) { for(int i = useDays; i < vehicleItemDTO.getTotalNum(); i++) {
residueAmount = residueAmount.add(vmcpds.get(i).getPrice()); residueAmount = residueAmount.add(vmcpds.get(i).getPrice());
inProgressVO.getViolateAmountList().add(vmcpds.get(i));
} }
String violateDesc = StrUtil.format("{}元", residueAmount.toString()); String violateDesc = StrUtil.format("{}元", residueAmount.toString());
if(residueDays >= 2) { if(residueDays >= 2) {
residueDays = 2; residueDays = 2;
residueAmount = BigDecimal.ZERO; residueAmount = BigDecimal.ZERO;
inProgressVO.setViolateAmountList(CollUtil.newArrayList());
for(int i = useDays; i < (useDays + residueDays); i++) { for(int i = useDays; i < (useDays + residueDays); i++) {
residueAmount = residueAmount.add(vmcpds.get(i).getPrice()); residueAmount = residueAmount.add(vmcpds.get(i).getPrice());
inProgressVO.getViolateAmountList().add(vmcpds.get(i));
} }
violateDesc += StrUtil.format("(封顶{}元)", residueAmount); violateDesc += StrUtil.format("(封顶{}元)", residueAmount);
} }
inProgressVO.setViolateAmount(residueAmount); inProgressVO.setViolateAmount(residueAmount);
inProgressVO.setViolateDesc(" 提前还车违约金:"+ violateDesc); inProgressVO.setViolateDesc(" 提前还车违约金:"+ violateDesc);
OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_ADVANCE, OrderAccountDeduction.ORIGIN_DEPOSIT); OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_ADVANCE, OrderAccountDeduction.ORIGIN_DEPOSIT);
...@@ -240,6 +245,8 @@ public class OrderCalculateBiz { ...@@ -240,6 +245,8 @@ public class OrderCalculateBiz {
inProgressVO.setViolateAmount(overAmount); inProgressVO.setViolateAmount(overAmount);
inProgressVO.setViolateDesc(" 延期还车违约金:"+ violateDesc); inProgressVO.setViolateDesc(" 延期还车违约金:"+ violateDesc);
inProgressVO.setOverAmountList(overAmountList); inProgressVO.setOverAmountList(overAmountList);
inProgressVO.setViolateAmountList(overAmountList);
OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_DELAY, OrderAccountDeduction.ORIGIN_DEPOSIT); OrderAccountDeduction violateDeduction = orderAccountBiz.initDeduction(inProgressVO.getViolateAmount(), violateDesc, DeductionTypeEnum.VIOLATE_DELAY, OrderAccountDeduction.ORIGIN_DEPOSIT);
oad.getDeductions().add(violateDeduction); oad.getDeductions().add(violateDeduction);
} }
......
...@@ -175,6 +175,8 @@ public class OrderCancelBiz { ...@@ -175,6 +175,8 @@ public class OrderCancelBiz {
csv.setHadConpon((StrUtil.isNotBlank(baseOrder.getCouponTickerNos())? Boolean.TRUE: Boolean.FALSE)); csv.setHadConpon((StrUtil.isNotBlank(baseOrder.getCouponTickerNos())? Boolean.TRUE: Boolean.FALSE));
csv.setViolateAmount(BigDecimal.ZERO); csv.setViolateAmount(BigDecimal.ZERO);
csv.setViolateDesc(""); csv.setViolateDesc("");
csv.setAbleUsedDayNum(inProgressVO.getUseAmountList().size());
csv.setSameUseUnitPriceFromList(inProgressVO.getUseAmountList()); csv.setSameUseUnitPriceFromList(inProgressVO.getUseAmountList());
csv.setSameOverUnitPriceFromList(inProgressVO.getOverAmountList()); csv.setSameOverUnitPriceFromList(inProgressVO.getOverAmountList());
csv.setUseAmountList(inProgressVO.getUseAmountList()); csv.setUseAmountList(inProgressVO.getUseAmountList());
...@@ -194,6 +196,8 @@ public class OrderCancelBiz { ...@@ -194,6 +196,8 @@ public class OrderCancelBiz {
baseOrder.setViolateAmount(csv.getViolateAmount()); baseOrder.setViolateAmount(csv.getViolateAmount());
baseOrder.setExtraAmount(inProgressVO.getExtraAmount()); baseOrder.setExtraAmount(inProgressVO.getExtraAmount());
//最后设置DeductionList
csv.setDeductionList(oad.getDeductions());
csv.initParamJson(); csv.initParamJson();
//orderTemplateBiz.handleCostDetailExtend(csv); //orderTemplateBiz.handleCostDetailExtend(csv);
orvd.handelCostDetailExtend(csv); orvd.handelCostDetailExtend(csv);
...@@ -226,6 +230,10 @@ public class OrderCancelBiz { ...@@ -226,6 +230,10 @@ public class OrderCancelBiz {
CancelNoStartVO cnsv = new CancelNoStartVO(){{ CancelNoStartVO cnsv = new CancelNoStartVO(){{
setViolateAmount(deduction.getAmount()); setViolateAmount(deduction.getAmount());
setViolateDesc(deduction.getName()); setViolateDesc(deduction.getName());
//设置违约金日期费用列表
setViolateAmountList(vehicleItemDTO.getVehicleDetail());
setSameViolateUnitPriceFromList(vehicleItemDTO.getVehicleDetail());
}}; }};
//设置订单数据 //设置订单数据
......
...@@ -325,7 +325,6 @@ public class BackStageOrderController extends CommonBaseController implements Us ...@@ -325,7 +325,6 @@ public class BackStageOrderController extends CommonBaseController implements Us
for (OrderPageVO orderPageVO : pageDataVO.getData()) { for (OrderPageVO orderPageVO : pageDataVO.getData()) {
if (orderPageVO.getOrderRentVehicleDetail() != null && orderPageVO.getOrderRentVehicleDetail().getVehicleId() != null) { if (orderPageVO.getOrderRentVehicleDetail() != null && orderPageVO.getOrderRentVehicleDetail().getVehicleId() != null) {
ObjectRestResponse<Vehicle> restResponse = vehicleFeign.get(orderPageVO.getOrderRentVehicleDetail().getVehicleId()); ObjectRestResponse<Vehicle> restResponse = vehicleFeign.get(orderPageVO.getOrderRentVehicleDetail().getVehicleId());
log.info("获取车辆信息返回消息:{}", restResponse.getMessage());
if (restResponse.getData() != null) { if (restResponse.getData() != null) {
orderPageVO.setVehicalNumberPlat(restResponse.getData().getNumberPlate()); orderPageVO.setVehicalNumberPlat(restResponse.getData().getNumberPlate());
orderPageVO.setCode(restResponse.getData().getCode()); orderPageVO.setCode(restResponse.getData().getCode());
......
...@@ -59,7 +59,7 @@ public class SysRegionBiz extends BaseBiz<SysRegionMapper, SysRegion> { ...@@ -59,7 +59,7 @@ public class SysRegionBiz extends BaseBiz<SysRegionMapper, SysRegion> {
} }
} }
if(!hasCache){//从db读 if(!hasCache && ids != null){//从db读
rs = mapper.getByIdList(ids); rs = mapper.getByIdList(ids);
} }
return rs; return rs;
......
...@@ -256,7 +256,7 @@ public class VehicleActiveService { ...@@ -256,7 +256,7 @@ public class VehicleActiveService {
bookVehicleVo.setBookEndDate(null); bookVehicleVo.setBookEndDate(null);
bookVehicleVo.setUnbookStartDate(actualArrivalDate.toString(DATE_TIME_FORMATTER)); bookVehicleVo.setUnbookStartDate(actualArrivalDate.toString(DATE_TIME_FORMATTER));
bookVehicleVo.setUnbookEndDate(arrivalDate.toString(DATE_TIME_FORMATTER)); bookVehicleVo.setUnbookEndDate(arrivalDate.toString(DATE_TIME_FORMATTER));
bookVehicleVo.setRemark(bookVehicleVo.getRemark() + " 用户提前还车,取消剩余天数, 初始预定结束时间是," + new DateTime(vehicleBookRecord.getBookEndDate()).toString(DATE_TIME_FORMATTER)); bookVehicleVo.setRemark(bookVehicleVo.getRemark()==null?"": bookVehicleVo.getRemark()+ " 用户提前还车,取消剩余天数, 初始预定结束时间是," + new DateTime(vehicleBookRecord.getBookEndDate()).toString(DATE_TIME_FORMATTER));
vehicleBookRecord.setRemark(bookVehicleVo.getRemark()); vehicleBookRecord.setRemark(bookVehicleVo.getRemark());
try { try {
Boolean hasSuc = vehicleBiz.unbookVehicle(bookVehicleVo); Boolean hasSuc = vehicleBiz.unbookVehicle(bookVehicleVo);
...@@ -268,7 +268,7 @@ public class VehicleActiveService { ...@@ -268,7 +268,7 @@ public class VehicleActiveService {
log.error(e.getMessage(), e);; log.error(e.getMessage(), e);;
} }
} else if (actualArrivalDate.compareTo(arrivalDate) > 0) {//实际还车时间大于预计还车时间 } else if (actualArrivalDate.compareTo(arrivalDate) > 0) {//实际还车时间大于预计还车时间
vehicleBookRecord.setRemark(vehicleBookRecord.getRemark() + " 用户延期还车,实际占用日期"); vehicleBookRecord.setRemark(vehicleBookRecord.getRemark()==null?"": vehicleBookRecord.getRemark() + " 用户延期还车,实际占用日期");
} }
updateBookRecordStatus(vehicleBookRecord, 2); updateBookRecordStatus(vehicleBookRecord, 2);
departureLog.setMileageEnd(arrivalVo.getMileage()); departureLog.setMileageEnd(arrivalVo.getMileage());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment