Compare commits
2 Commits
c9d8681199
...
a7fe2cd625
| Author | SHA1 | Date | |
|---|---|---|---|
| a7fe2cd625 | |||
| 987e80d657 |
@ -132,6 +132,10 @@ public class CompanyController extends BaseController
|
|||||||
{
|
{
|
||||||
return error("新增失败,手机号码已存在");
|
return error("新增失败,手机号码已存在");
|
||||||
}
|
}
|
||||||
|
if (Company.NOT_UNIQUE.equals(companyService.checkNameUnique(company)))
|
||||||
|
{
|
||||||
|
return error("新增失败,运营商名称'" + company.getCompanyName() + "'已存在");
|
||||||
|
}
|
||||||
company.setCreateBy(getLoginName());
|
company.setCreateBy(getLoginName());
|
||||||
int flag = companyService.insertCompany(company);
|
int flag = companyService.insertCompany(company);
|
||||||
if(flag > 0){
|
if(flag > 0){
|
||||||
@ -167,6 +171,10 @@ public class CompanyController extends BaseController
|
|||||||
{
|
{
|
||||||
return error("修改失败,手机号码已存在");
|
return error("修改失败,手机号码已存在");
|
||||||
}
|
}
|
||||||
|
if (Company.NOT_UNIQUE.equals(companyService.checkNameUnique(company)))
|
||||||
|
{
|
||||||
|
return error("新增失败,运营商名称'" + company.getCompanyName() + "'已存在");
|
||||||
|
}
|
||||||
company.setUpdateBy(getLoginName());
|
company.setUpdateBy(getLoginName());
|
||||||
int flag = companyService.updateCompany(company);
|
int flag = companyService.updateCompany(company);
|
||||||
if(flag > 0){
|
if(flag > 0){
|
||||||
|
|||||||
@ -111,7 +111,13 @@ public class ZcCarController extends BaseController
|
|||||||
// 校验 VIN 是否唯一
|
// 校验 VIN 是否唯一
|
||||||
if (StringUtils.isNotEmpty(zcCar.getVin())
|
if (StringUtils.isNotEmpty(zcCar.getVin())
|
||||||
&& OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkVinUnique(zcCar))) {
|
&& OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkVinUnique(zcCar))) {
|
||||||
return error("新增失败,车机号已存在");
|
return error("新增失败,车架号已存在");
|
||||||
|
}
|
||||||
|
if (OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkLicensePlateUnique(zcCar))) {
|
||||||
|
return error("新增失败,车牌号已存在");
|
||||||
|
}
|
||||||
|
if (OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkLotNumberUnique(zcCar))) {
|
||||||
|
return error("新增失败,LOT识别号已存在");
|
||||||
}
|
}
|
||||||
return toAjax(zcCarService.insertZcCar(zcCar));
|
return toAjax(zcCarService.insertZcCar(zcCar));
|
||||||
}
|
}
|
||||||
@ -143,9 +149,14 @@ public class ZcCarController extends BaseController
|
|||||||
// 校验 VIN 是否唯一
|
// 校验 VIN 是否唯一
|
||||||
if (StringUtils.isNotEmpty(zcCar.getVin())
|
if (StringUtils.isNotEmpty(zcCar.getVin())
|
||||||
&& OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkVinUnique(zcCar))) {
|
&& OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkVinUnique(zcCar))) {
|
||||||
return error("修改失败,车机号已存在");
|
return error("修改失败,车架号已存在");
|
||||||
|
}
|
||||||
|
if (OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkLicensePlateUnique(zcCar))) {
|
||||||
|
return error("新增失败,车牌号已存在");
|
||||||
|
}
|
||||||
|
if (OperationConstants.USER_VIN_NOT_UNIQUE.equals(zcCarService.checkLotNumberUnique(zcCar))) {
|
||||||
|
return error("新增失败,LOT识别号已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
return toAjax(zcCarService.updateZcCar(zcCar));
|
return toAjax(zcCarService.updateZcCar(zcCar));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -114,23 +114,31 @@ public class ZcRentCarRuleController extends BaseController
|
|||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult addSave(@RequestParam(value = "batteryRules",required = false) List<Long> batteryRuleIds, ZcRentCarRule zcRentCarRule)
|
public AjaxResult addSave(@RequestParam(value = "batteryRules",required = false) List<Long> batteryRuleIds, ZcRentCarRule zcRentCarRule)
|
||||||
{
|
{
|
||||||
|
StringBuffer remark = new StringBuffer();
|
||||||
// 如果是按天租,验证选择的租电套餐支持天数是否一致
|
// 如果是按天租,验证选择的租电套餐支持天数是否一致
|
||||||
if("3".equals(zcRentCarRule.getRentalType())){
|
if("2".equals(zcRentCarRule.getRentalType()) || "3".equals(zcRentCarRule.getRentalType())){
|
||||||
String[] stringArray = batteryRuleIds.stream()
|
String[] stringArray = batteryRuleIds.stream()
|
||||||
.map(String::valueOf)
|
.map(String::valueOf)
|
||||||
.toArray(String[]::new);
|
.toArray(String[]::new);
|
||||||
List<ZcRentBatteyRule> batteyRuleList = zcRentBatteyRuleService.selectZcRentBatteyRuleByIds(stringArray);
|
List<ZcRentBatteyRule> batteyRuleList = zcRentBatteyRuleService.selectZcRentBatteyRuleByIds(stringArray);
|
||||||
for (ZcRentBatteyRule batteyRule : batteyRuleList) {
|
for (ZcRentBatteyRule batteyRule : batteyRuleList) {
|
||||||
|
if("3".equals(zcRentCarRule.getRentalType())) {
|
||||||
//2标识按天租,或者租电套餐1标识日租中租赁天数大于1天也为按天租
|
//2标识按天租,或者租电套餐1标识日租中租赁天数大于1天也为按天租
|
||||||
Long duration= batteyRule.getDuration();
|
Long duration = batteyRule.getDuration();
|
||||||
if(batteyRule.getDurationType() == 2){
|
if (batteyRule.getDurationType() == 2) {
|
||||||
duration = duration * 30;
|
duration = duration * 30;
|
||||||
}
|
}
|
||||||
if(!String.valueOf(duration).equals(String.valueOf(zcRentCarRule.getRentalDays()))){
|
if (!String.valueOf(duration).equals(String.valueOf(zcRentCarRule.getRentalDays()))) {
|
||||||
return error("选择租电套餐的租赁天数与租车套餐的租赁天数不一致。");
|
return error("选择租电套餐的租赁天数与租车套餐的租赁天数不一致。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
remark.append(batteyRule.getCityName()).append(batteyRule.getTitle()).append(",");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if("2".equals(zcRentCarRule.getRentalType())){
|
||||||
|
zcRentCarRule.setRentalDays(1L);
|
||||||
|
}
|
||||||
|
zcRentCarRule.setRemark(remark.toString());
|
||||||
zcRentCarRule.setRuleCode(generateTimestampBasedCode());
|
zcRentCarRule.setRuleCode(generateTimestampBasedCode());
|
||||||
zcRentCarRule.setCreateBy(getLoginName());
|
zcRentCarRule.setCreateBy(getLoginName());
|
||||||
int flag = zcRentCarRuleService.insertZcRentCarRule(zcRentCarRule);
|
int flag = zcRentCarRuleService.insertZcRentCarRule(zcRentCarRule);
|
||||||
|
|||||||
@ -179,6 +179,9 @@ public class Company extends BaseEntity
|
|||||||
/** */
|
/** */
|
||||||
private String extend5;
|
private String extend5;
|
||||||
|
|
||||||
|
public final static String UNIQUE = "0";
|
||||||
|
public final static String NOT_UNIQUE = "1";
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|||||||
@ -26,7 +26,7 @@ public interface CompanyMapper
|
|||||||
* @return 运营商对象
|
* @return 运营商对象
|
||||||
*/
|
*/
|
||||||
Company checkPhoneUnique(String phone);
|
Company checkPhoneUnique(String phone);
|
||||||
|
public Company checkNameUnique(String name);
|
||||||
/**
|
/**
|
||||||
* 查询运营商列表
|
* 查询运营商列表
|
||||||
*
|
*
|
||||||
|
|||||||
@ -63,4 +63,8 @@ public interface ZcCarMapper
|
|||||||
public int deleteZcCarByIds(String[] ids);
|
public int deleteZcCarByIds(String[] ids);
|
||||||
|
|
||||||
public ZcCar checkVinUnique(String vin);
|
public ZcCar checkVinUnique(String vin);
|
||||||
|
|
||||||
|
public ZcCar checkLicensePlateUnique(String licensePlate);
|
||||||
|
|
||||||
|
public ZcCar checkLotNumberUnique(String lotNumber);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,4 +73,6 @@ public interface ICompanyService
|
|||||||
public int deleteCompanyById(Long id);
|
public int deleteCompanyById(Long id);
|
||||||
|
|
||||||
public int changeStatus(Company company);
|
public int changeStatus(Company company);
|
||||||
|
|
||||||
|
public String checkNameUnique(Company company);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,12 +63,16 @@ public interface IZcCarService
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验车机号 (VIN) 是否唯一
|
* 校验车架号 (VIN) 是否唯一
|
||||||
*
|
*
|
||||||
* @return 是否唯一 (0:唯一, 1:不唯一)
|
* @return 是否唯一 (0:唯一, 1:不唯一)
|
||||||
*/
|
*/
|
||||||
String checkVinUnique(ZcCar zcCar);
|
String checkVinUnique(ZcCar zcCar);
|
||||||
|
|
||||||
|
String checkLicensePlateUnique(ZcCar zcCar);
|
||||||
|
|
||||||
|
String checkLotNumberUnique(ZcCar zcCar);
|
||||||
|
|
||||||
public int changeStatus(ZcCar zcCar);
|
public int changeStatus(ZcCar zcCar);
|
||||||
|
|
||||||
public String importCar(List<ZcCar> carList, Boolean isUpdateSupport, SysUser user);
|
public String importCar(List<ZcCar> carList, Boolean isUpdateSupport, SysUser user);
|
||||||
|
|||||||
@ -195,4 +195,15 @@ public class CompanyServiceImpl implements ICompanyService
|
|||||||
return flag;
|
return flag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkNameUnique(Company company) {
|
||||||
|
Long id = StringUtils.isNull(company.getId()) ? -1L : company.getId();
|
||||||
|
Company info = companyMapper.checkNameUnique(company.getCompanyName());
|
||||||
|
if (StringUtils.isNotNull(info) && info.getId().longValue() != id.longValue())
|
||||||
|
{
|
||||||
|
return Company.NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return Company.UNIQUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,16 +125,45 @@ public class ZcCarServiceImpl implements IZcCarService
|
|||||||
return zcCarMapper.deleteZcCarById(id);
|
return zcCarMapper.deleteZcCarById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private String checkFieldUnique(ZcCar zcCar, String fieldName, Object fieldValue) {
|
||||||
public String checkVinUnique(ZcCar zcCar) {
|
|
||||||
Long carId = StringUtils.isNull(zcCar.getId()) ? -1L : zcCar.getId();
|
Long carId = StringUtils.isNull(zcCar.getId()) ? -1L : zcCar.getId();
|
||||||
ZcCar info = zcCarMapper.checkVinUnique(zcCar.getVin());
|
ZcCar info = null;
|
||||||
if (StringUtils.isNotNull(info) && info.getId().longValue() != carId.longValue()){
|
|
||||||
|
switch (fieldName) {
|
||||||
|
case "vin":
|
||||||
|
info = zcCarMapper.checkVinUnique((String) fieldValue);
|
||||||
|
break;
|
||||||
|
case "licensePlate":
|
||||||
|
info = zcCarMapper.checkLicensePlateUnique((String) fieldValue);
|
||||||
|
break;
|
||||||
|
case "lotNumber":
|
||||||
|
info = zcCarMapper.checkLotNumberUnique((String) fieldValue);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return OperationConstants.USER_VIN_UNIQUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotNull(info) && info.getId().longValue() != carId.longValue()) {
|
||||||
return OperationConstants.USER_VIN_NOT_UNIQUE;
|
return OperationConstants.USER_VIN_NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
return OperationConstants.USER_VIN_UNIQUE;
|
return OperationConstants.USER_VIN_UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkVinUnique(ZcCar zcCar) {
|
||||||
|
return checkFieldUnique(zcCar, "vin", zcCar.getVin());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkLicensePlateUnique(ZcCar zcCar) {
|
||||||
|
return checkFieldUnique(zcCar, "licensePlate", zcCar.getLicensePlate());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkLotNumberUnique(ZcCar zcCar) {
|
||||||
|
return checkFieldUnique(zcCar, "lotNumber", zcCar.getLotNumber());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int changeStatus(ZcCar zcCar) {
|
public int changeStatus(ZcCar zcCar) {
|
||||||
zcCar.setUpdateTime(DateUtils.getNowDate());
|
zcCar.setUpdateTime(DateUtils.getNowDate());
|
||||||
@ -170,36 +199,46 @@ public class ZcCarServiceImpl implements IZcCarService
|
|||||||
{
|
{
|
||||||
// 验证是否存在
|
// 验证是否存在
|
||||||
ZcCar u = zcCarMapper.checkVinUnique(car.getVin());
|
ZcCar u = zcCarMapper.checkVinUnique(car.getVin());
|
||||||
if (StringUtils.isNull(u))
|
ZcCar u2 = zcCarMapper.checkLicensePlateUnique(car.getLicensePlate());
|
||||||
{
|
ZcCar u3 = zcCarMapper.checkLotNumberUnique(car.getLotNumber());
|
||||||
// 车辆归属字典转换
|
|
||||||
car.setBelongType(DictUtils.getDictValue("key_car_belong_type", car.getBelongType(), car.getBelongType()));
|
// 只有当所有唯一性校验都通过时才插入数据
|
||||||
|
if (StringUtils.isNull(u) && StringUtils.isNull(u2) && StringUtils.isNull(u3)) {
|
||||||
// 设置运营商ID
|
// 设置运营商ID
|
||||||
if (StringUtils.isNotEmpty(car.getOperatorName()) && companyMap.containsKey(car.getOperatorName())) {
|
if (StringUtils.isNotEmpty(car.getOperatorName()) && companyMap.containsKey(car.getOperatorName())) {
|
||||||
car.setOperatorId(companyMap.get(car.getOperatorName()));
|
car.setOperatorId(companyMap.get(car.getOperatorName()));
|
||||||
|
}else{
|
||||||
|
// 没有匹配时置空
|
||||||
|
car.setOperatorName("");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置门店ID
|
// 设置门店ID
|
||||||
if (StringUtils.isNotEmpty(car.getStoreName()) && storeMap.containsKey(car.getStoreName())) {
|
if (StringUtils.isNotEmpty(car.getStoreName()) && storeMap.containsKey(car.getStoreName())) {
|
||||||
car.setStoreId(storeMap.get(car.getStoreName()));
|
car.setStoreId(storeMap.get(car.getStoreName()));
|
||||||
|
}else{
|
||||||
|
// 没有匹配时置空
|
||||||
|
car.setStoreName("");
|
||||||
}
|
}
|
||||||
car.setCreateBy(user.getLoginName());
|
car.setCreateBy(user.getLoginName());
|
||||||
|
|
||||||
this.insertZcCar(car);
|
this.insertZcCar(car);
|
||||||
// processedList.add(car);
|
|
||||||
successNum++;
|
successNum++;
|
||||||
successMsg.append("<br/>" + successNum + "、车机号 " + car.getVin() + " 导入成功");
|
successMsg.append("<br/>" + successNum + "导入成功");
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
failureNum++;
|
failureNum++;
|
||||||
failureMsg.append("<br/>" + failureNum + "、车机号 " + car.getVin() + " 已存在");
|
if (StringUtils.isNotNull(u)) {
|
||||||
|
failureMsg.append("<br/>" + failureNum + "、车架号 " + car.getVin() + " 已存在");
|
||||||
|
} else if (StringUtils.isNotNull(u2)) {
|
||||||
|
failureMsg.append("<br/>" + failureNum + "、车牌号 " + car.getLicensePlate() + " 已存在");
|
||||||
|
} else if (StringUtils.isNotNull(u3)) {
|
||||||
|
failureMsg.append("<br/>" + failureNum + "、Lot号 " + car.getLotNumber() + " 已存在");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
failureNum++;
|
failureNum++;
|
||||||
String msg = "<br/>" + failureNum + "、车机号 " + car.getVin() + " 导入失败:";
|
String msg = "<br/>" + failureNum + " 导入失败:";
|
||||||
failureMsg.append(msg + e.getMessage());
|
failureMsg.append(msg + e.getMessage());
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.ruoyi.operation.util;
|
|||||||
public class OperationConstants {
|
public class OperationConstants {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车机号 (VIN) 唯一
|
* 车架号 (VIN) 唯一
|
||||||
*/
|
*/
|
||||||
public static final String USER_VIN_UNIQUE = "0";
|
public static final String USER_VIN_UNIQUE = "0";
|
||||||
public static final String USER_VIN_NOT_UNIQUE = "1";
|
public static final String USER_VIN_NOT_UNIQUE = "1";
|
||||||
|
|||||||
@ -127,6 +127,9 @@ public class ZcOrderMain extends BaseEntity
|
|||||||
@Excel(name = "实际还车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "实际还车时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date actEndRentTime;
|
private Date actEndRentTime;
|
||||||
|
|
||||||
|
/** 租赁时长(小时/天) */
|
||||||
|
@Excel(name = "租赁时长(小时/天)")
|
||||||
|
private Long rentalDuration;
|
||||||
/** 逾期天数 */
|
/** 逾期天数 */
|
||||||
@Excel(name = "逾期天数")
|
@Excel(name = "逾期天数")
|
||||||
private Long overdueDays;
|
private Long overdueDays;
|
||||||
@ -335,6 +338,15 @@ public class ZcOrderMain extends BaseEntity
|
|||||||
{
|
{
|
||||||
return startRentTime;
|
return startRentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getRentalDuration() {
|
||||||
|
return rentalDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRentalDuration(Long rentalDuration) {
|
||||||
|
this.rentalDuration = rentalDuration;
|
||||||
|
}
|
||||||
|
|
||||||
public void setOverdueDays(Long overdueDays)
|
public void setOverdueDays(Long overdueDays)
|
||||||
{
|
{
|
||||||
this.overdueDays = overdueDays;
|
this.overdueDays = overdueDays;
|
||||||
|
|||||||
@ -111,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="checkPhoneUnique" parameterType="string" resultType="com.ruoyi.operation.domain.Company">
|
<select id="checkPhoneUnique" parameterType="string" resultType="com.ruoyi.operation.domain.Company">
|
||||||
SELECT * FROM zc_company WHERE del_flag = 0 AND phone = #{phone}
|
SELECT * FROM zc_company WHERE del_flag = 0 AND phone = #{phone}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="checkNameUnique" resultType="com.ruoyi.operation.domain.Company">
|
||||||
|
SELECT * FROM zc_company WHERE del_flag = 0 AND company_name = #{companyName} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertCompany" parameterType="Company" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertCompany" parameterType="Company" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into zc_company
|
insert into zc_company
|
||||||
|
|||||||
@ -50,6 +50,7 @@
|
|||||||
<select id="selectZcCarDamageList" parameterType="ZcCarDamage" resultMap="ZcCarDamageResult">
|
<select id="selectZcCarDamageList" parameterType="ZcCarDamage" resultMap="ZcCarDamageResult">
|
||||||
<include refid="selectZcCarDamageVo"/>
|
<include refid="selectZcCarDamageVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
a.del_flag = 0
|
||||||
<if test="carId != null "> and a.car_id = #{carId}</if>
|
<if test="carId != null "> and a.car_id = #{carId}</if>
|
||||||
<if test="damageType != null and damageType != ''"> and a.damage_type = #{damageType}</if>
|
<if test="damageType != null and damageType != ''"> and a.damage_type = #{damageType}</if>
|
||||||
<if test="damageReason != null and damageReason != ''"> and a.damage_reason = #{damageReason}</if>
|
<if test="damageReason != null and damageReason != ''"> and a.damage_reason = #{damageReason}</if>
|
||||||
|
|||||||
@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectZcCarList" parameterType="ZcCar" resultMap="ZcCarResult">
|
<select id="selectZcCarList" parameterType="ZcCar" resultMap="ZcCarResult">
|
||||||
<include refid="selectZcCarVo"/>
|
<include refid="selectZcCarVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
del_flag = 0
|
||||||
<if test="vin != null and vin != ''"> and vin like concat('%', #{vin}, '%')</if>
|
<if test="vin != null and vin != ''"> and vin like concat('%', #{vin}, '%')</if>
|
||||||
<if test="licensePlate != null and licensePlate != ''"> and license_plate like concat('%', #{licensePlate}, '%')</if>
|
<if test="licensePlate != null and licensePlate != ''"> and license_plate like concat('%', #{licensePlate}, '%')</if>
|
||||||
<if test="brandId != null "> and brand_id = #{brandId}</if>
|
<if test="brandId != null "> and brand_id = #{brandId}</if>
|
||||||
@ -86,7 +87,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="checkVinUnique" resultType="com.ruoyi.operation.domain.ZcCar">
|
<select id="checkVinUnique" resultType="com.ruoyi.operation.domain.ZcCar">
|
||||||
SELECT * FROM zc_car WHERE del_flag = 0 AND vin = #{vin}
|
SELECT * FROM zc_car WHERE del_flag = 0 AND vin = #{vin}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="checkLicensePlateUnique" resultType="com.ruoyi.operation.domain.ZcCar">
|
||||||
|
SELECT * FROM zc_car WHERE del_flag = 0 AND license_plate = #{licensePlate} limit 1
|
||||||
|
</select>
|
||||||
|
<select id="checkLotNumberUnique" resultType="com.ruoyi.operation.domain.ZcCar">
|
||||||
|
SELECT * FROM zc_car WHERE del_flag = 0 AND lot_number = #{lotNumber} limit 1
|
||||||
|
</select>
|
||||||
<insert id="insertZcCar" parameterType="ZcCar" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertZcCar" parameterType="ZcCar" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into zc_car
|
insert into zc_car
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|||||||
@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectZcCarModelList" parameterType="ZcCarModel" resultMap="ZcCarModelResult">
|
<select id="selectZcCarModelList" parameterType="ZcCarModel" resultMap="ZcCarModelResult">
|
||||||
<include refid="selectZcCarModelVo"/>
|
<include refid="selectZcCarModelVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
del_flag = 0
|
||||||
<if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
|
<if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
|
||||||
<if test="brandId != null"> and brand_id = #{brandId}</if>
|
<if test="brandId != null"> and brand_id = #{brandId}</if>
|
||||||
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
|
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
|
||||||
|
|||||||
@ -88,7 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectZcRentBatteyRuleByIds" resultMap="ZcRentBatteyRuleResult">
|
<select id="selectZcRentBatteyRuleByIds" resultMap="ZcRentBatteyRuleResult">
|
||||||
select * from zc_rent_battey_rule where id in
|
<include refid="selectZcRentBatteyRuleVo2"/>
|
||||||
|
where a.id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@ -43,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="endRentTime" column="main_end_rent_time" />
|
<result property="endRentTime" column="main_end_rent_time" />
|
||||||
<result property="reqEndRentTime" column="main_req_end_rent_time" />
|
<result property="reqEndRentTime" column="main_req_end_rent_time" />
|
||||||
<result property="actEndRentTime" column="main_act_end_rent_time" />
|
<result property="actEndRentTime" column="main_act_end_rent_time" />
|
||||||
|
<result property="rentalDuration" column="main_rental_duration" />
|
||||||
<result property="overdueDays" column="main_overdue_days" />
|
<result property="overdueDays" column="main_overdue_days" />
|
||||||
<result property="renewalTimes" column="main_renewal_times" />
|
<result property="renewalTimes" column="main_renewal_times" />
|
||||||
<result property="chargeTimes" column="main_charge_times" />
|
<result property="chargeTimes" column="main_charge_times" />
|
||||||
@ -68,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
b.order_status as main_order_status, b.vehicle_id as main_vehicle_id, b.car_model_id as main_car_model_id, b.customer_id as main_customer_id, b.customer_name as main_customer_name, b.customer_phone as main_customer_phone,
|
b.order_status as main_order_status, b.vehicle_id as main_vehicle_id, b.car_model_id as main_car_model_id, b.customer_id as main_customer_id, b.customer_name as main_customer_name, b.customer_phone as main_customer_phone,
|
||||||
b.battery_type as main_battery_type, b.rental_type as main_rental_type, b.rental_days as main_rental_days, b.rental_price as main_rental_price, b.deposit_price as main_deposit_price, b.overdue_fee as main_overdue_fee,
|
b.battery_type as main_battery_type, b.rental_type as main_rental_type, b.rental_days as main_rental_days, b.rental_price as main_rental_price, b.deposit_price as main_deposit_price, b.overdue_fee as main_overdue_fee,
|
||||||
b.overdue_type as main_overdue_type, b.is_deposit_free as main_is_deposit_free, b.is_auto_deduct as main_is_auto_deduct, b.first_order_time as main_first_order_time, b.pick_car_time as main_pick_car_time, b.start_rent_time as main_start_rent_time,
|
b.overdue_type as main_overdue_type, b.is_deposit_free as main_is_deposit_free, b.is_auto_deduct as main_is_auto_deduct, b.first_order_time as main_first_order_time, b.pick_car_time as main_pick_car_time, b.start_rent_time as main_start_rent_time,
|
||||||
b.end_rent_time as main_end_rent_time, b.req_end_rent_time as main_req_end_rent_time, b.act_end_rent_time as main_act_end_rent_time, b.overdue_days as main_overdue_days, b.renewal_times as main_renewal_times, b.charge_times as main_charge_times,
|
b.end_rent_time as main_end_rent_time, b.req_end_rent_time as main_req_end_rent_time, b.act_end_rent_time as main_act_end_rent_time, b.overdue_days as main_overdue_days, b.rental_duration as main_rental_duration, b.renewal_times as main_renewal_times, b.charge_times as main_charge_times,
|
||||||
b.rent_car_rule_id as main_rent_car_rule_id, b.rent_battey_rule_id as main_rent_battey_rule_id, b.damage_amount as main_damage_amount,b.damage_desc as main_damage_desc, b.order_amount as main_order_amount, b.overdue_amount as main_overdue_amount,
|
b.rent_car_rule_id as main_rent_car_rule_id, b.rent_battey_rule_id as main_rent_battey_rule_id, b.damage_amount as main_damage_amount,b.damage_desc as main_damage_desc, b.order_amount as main_order_amount, b.overdue_amount as main_overdue_amount,
|
||||||
b.end_order_time as main_end_order_time, b.create_time as main_create_time, b.update_time as main_update_time ,
|
b.end_order_time as main_end_order_time, b.create_time as main_create_time, b.update_time as main_update_time ,
|
||||||
c.company_name as main_operator_name,
|
c.company_name as main_operator_name,
|
||||||
|
|||||||
@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="endRentTime" column="end_rent_time" />
|
<result property="endRentTime" column="end_rent_time" />
|
||||||
<result property="reqEndRentTime" column="req_end_rent_time" />
|
<result property="reqEndRentTime" column="req_end_rent_time" />
|
||||||
<result property="actEndRentTime" column="act_end_rent_time" />
|
<result property="actEndRentTime" column="act_end_rent_time" />
|
||||||
|
<result property="rentalDuration" column="rental_duration" />
|
||||||
<result property="overdueDays" column="overdue_days" />
|
<result property="overdueDays" column="overdue_days" />
|
||||||
<result property="renewalTimes" column="renewal_times" />
|
<result property="renewalTimes" column="renewal_times" />
|
||||||
<result property="chargeTimes" column="charge_times" />
|
<result property="chargeTimes" column="charge_times" />
|
||||||
@ -88,11 +89,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectZcOrderMainVo">
|
<sql id="selectZcOrderMainVo">
|
||||||
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, damage_amount,damage_desc, order_amount, overdue_amount, end_order_time, distribed, del_flag, create_time, update_time from zc_order_main
|
select order_id, order_no, order_status, operator_id, store_id, vehicle_id, car_model_id, customer_id, customer_name, customer_phone, battery_type, rental_type, rental_days, rental_price, deposit_price, overdue_fee, overdue_type, is_deposit_free, is_auto_deduct, first_order_time, pick_car_time, start_rent_time, end_rent_time, req_end_rent_time, act_end_rent_time, rental_duration, overdue_days, renewal_times, charge_times, rent_car_rule_id, rent_battey_rule_id, damage_amount,damage_desc, order_amount, overdue_amount, end_order_time, distribed, del_flag, create_time, update_time from zc_order_main
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
|
<select id="selectZcOrderMainList" parameterType="ZcOrderMain" resultMap="ZcOrderMainResult">
|
||||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc, a.order_amount, a.overdue_amount, a.end_order_time,a.distribed, a.del_flag, a.create_time, a.update_time,
|
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.rental_duration, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc, a.order_amount, a.overdue_amount, a.end_order_time,a.distribed, a.del_flag, a.create_time, a.update_time,
|
||||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
|
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate
|
||||||
from zc_order_main a
|
from zc_order_main a
|
||||||
left join zc_company c on c.id = a.operator_id
|
left join zc_company c on c.id = a.operator_id
|
||||||
@ -134,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
|
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
|
||||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.distribed, a.del_flag, a.create_time, a.update_time,
|
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.rental_duration, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.distribed, a.del_flag, a.create_time, a.update_time,
|
||||||
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.pay_status as sub_pay_status,b.transaction_id as sub_transaction_id, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time,
|
b.suborder_id as sub_suborder_id, b.order_id as sub_order_id, b.suborder_no as sub_suborder_no, b.suborder_type as sub_suborder_type, b.amount as sub_amount, b.payment_method as sub_payment_method, b.vin_battery_no as sub_vin_battery_no, b.created_at as sub_created_at, b.payment_id as sub_payment_id, b.paid_at as sub_paid_at, b.pay_status as sub_pay_status,b.transaction_id as sub_transaction_id, b.remark as sub_remark, b.del_flag as sub_del_flag, b.create_time as sub_create_time, b.update_time as sub_update_time,
|
||||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
||||||
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
||||||
@ -148,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectZcOrderMainImgByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderCarImgResult">
|
<select id="selectZcOrderMainImgByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderCarImgResult">
|
||||||
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.distribed, a.del_flag, a.create_time, a.update_time,
|
select a.order_id, a.order_no, a.order_status, a.operator_id, a.store_id, a.vehicle_id, a.car_model_id, a.customer_id, a.customer_name, a.customer_phone, a.battery_type, a.rental_type, a.rental_days, a.rental_price, a.deposit_price, a.overdue_fee, a.overdue_type, a.is_deposit_free, a.is_auto_deduct, a.first_order_time, a.pick_car_time, a.start_rent_time, a.end_rent_time, a.req_end_rent_time, a.act_end_rent_time, a.rental_duration, a.overdue_days, a.renewal_times, a.charge_times, a.rent_car_rule_id, a.rent_battey_rule_id, a.damage_amount,a.damage_desc,a.order_amount, a.overdue_amount, a.end_order_time, a.distribed, a.del_flag, a.create_time, a.update_time,
|
||||||
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
c.company_name as operator_name,s.name as store_name,zc.license_plate as license_plate,
|
||||||
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
i.id as sub_id, i.order_id as sub_order_id, i.order_no as sub_order_no, i.img_type as sub_img_type, i.img_url as sub_img_url, i.create_time as sub_create_time, i.update_time as sub_update_time
|
||||||
from zc_order_main a
|
from zc_order_main a
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">车辆归属:</label>
|
<label class="col-sm-3 control-label">车辆归属:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<select readonly name="belongType" class="form-control m-b" th:with="type=${@dict.getType('key_car_belong_type')}">
|
<select disabled name="belongType" class="form-control m-b" th:with="type=${@dict.getType('key_car_belong_type')}">
|
||||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{belongType}"></option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{belongType}"></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -191,7 +191,7 @@
|
|||||||
width: '120px'
|
width: '120px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'customerPhone',
|
field: 'zcOrderMain.customerPhone',
|
||||||
title: '联系电话',
|
title: '联系电话',
|
||||||
width: '120px'
|
width: '120px'
|
||||||
},
|
},
|
||||||
@ -215,9 +215,18 @@
|
|||||||
width: '120px'
|
width: '120px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'zcOrderMain.rentalDays',
|
field: 'zcOrderMain.rentalDuration',
|
||||||
title: '租赁天数',
|
title: '租赁时长',
|
||||||
width: '120px'
|
width: '120px',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
if (value != null) {
|
||||||
|
var str = "天";
|
||||||
|
if(row.zcOrderMain.rentalType == "1"){
|
||||||
|
str = "小时";
|
||||||
|
}
|
||||||
|
return value + str;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'zcOrderMain.orderAmount',
|
field: 'zcOrderMain.orderAmount',
|
||||||
|
|||||||
@ -184,9 +184,18 @@
|
|||||||
width: '120px'
|
width: '120px'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'rentalDays',
|
field: 'rentalDuration',
|
||||||
title: '租赁天数',
|
title: '租赁时长',
|
||||||
width: '120px'
|
width: '120px',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
if (value != null) {
|
||||||
|
var str = "天";
|
||||||
|
if(row.rentalType == "1"){
|
||||||
|
str = "小时";
|
||||||
|
}
|
||||||
|
return value + str;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'orderAmount',
|
field: 'orderAmount',
|
||||||
|
|||||||
Reference in New Issue
Block a user