oss上传,手动结束订单待完善,数据权限优化调整
This commit is contained in:
@ -85,6 +85,8 @@
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -30,7 +30,7 @@ public class AfterServiceStarted implements ApplicationRunner {
|
||||
// || ip.equals(CodeConstants.IP_28) || ip.equals(CodeConstants.IP_29)
|
||||
// || ip.equals(CodeConstants.IP_30) ) {
|
||||
// logger.info("--------------是否启动导入文件---------------:{}", ip);
|
||||
queueUploadTask.queueUploadFile();
|
||||
// queueUploadTask.queueUploadFile();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -53,6 +53,10 @@ public class ZcBaseUserController extends BaseController
|
||||
public TableDataInfo list(ZcBaseUser zcBaseUser)
|
||||
{
|
||||
startPage();
|
||||
// 运营者账号,只能查询所属商户数据
|
||||
if(UserConstants.USER_TYPE_02.equals(getSysUser().getUserType())){
|
||||
zcBaseUser.setOperatorId(getSysUser().getGroupId());
|
||||
}
|
||||
List<ZcBaseUser> list = zcBaseUserService.selectZcBaseUserList(zcBaseUser);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
/**
|
||||
* 租车用户信息对象 zc_base_user
|
||||
@ -54,6 +55,11 @@ public class ZcBaseUser extends BaseEntity
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
@Transient
|
||||
private Long operatorId;
|
||||
@Transient
|
||||
private Long storeId;
|
||||
|
||||
/** 用户与门店信息信息 */
|
||||
private List<ZcBaseUserStore> zcBaseUserStoreList;
|
||||
|
||||
@ -166,6 +172,22 @@ public class ZcBaseUser extends BaseEntity
|
||||
this.zcBaseUserStoreList = zcBaseUserStoreList;
|
||||
}
|
||||
|
||||
public Long getOperatorId() {
|
||||
return operatorId;
|
||||
}
|
||||
|
||||
public void setOperatorId(Long operatorId) {
|
||||
this.operatorId = operatorId;
|
||||
}
|
||||
|
||||
public Long getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
|
||||
public void setStoreId(Long storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@ -3,6 +3,7 @@ package com.ruoyi.baseUser.mapper;
|
||||
import java.util.List;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseUser;
|
||||
import com.ruoyi.baseUser.domain.ZcBaseUserStore;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租车用户信息Mapper接口
|
||||
@ -28,7 +29,7 @@ public interface ZcBaseUserMapper
|
||||
*/
|
||||
public List<ZcBaseUser> selectZcBaseUserList(ZcBaseUser zcBaseUser);
|
||||
|
||||
public List<ZcBaseUser> selectZcBaseUserByStoreId(Long storeId);
|
||||
public List<ZcBaseUser> selectZcBaseUserByStoreId(@Param("storeId") Long storeId, @Param("operatorId") Long operatorId);
|
||||
|
||||
public ZcBaseUser selectZcBaseUserByPhone(String phone);
|
||||
/**
|
||||
|
||||
@ -28,7 +28,7 @@ public interface IZcBaseUserService
|
||||
public List<ZcBaseUser> selectZcBaseUserList(ZcBaseUser zcBaseUser);
|
||||
|
||||
|
||||
public List<ZcBaseUser> selectZcBaseUserByStoreId(Long storeId);
|
||||
public List<ZcBaseUser> selectZcBaseUserByStoreId(Long storeId, Long operatorId);
|
||||
|
||||
/**
|
||||
* 新增租车用户信息
|
||||
|
||||
@ -53,8 +53,8 @@ public class ZcBaseUserServiceImpl implements IZcBaseUserService
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ZcBaseUser> selectZcBaseUserByStoreId(Long storeId){
|
||||
return zcBaseUserMapper.selectZcBaseUserByStoreId(storeId);
|
||||
public List<ZcBaseUser> selectZcBaseUserByStoreId(Long storeId, Long operatorId){
|
||||
return zcBaseUserMapper.selectZcBaseUserByStoreId(storeId,operatorId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -68,6 +68,7 @@ public class CompanyController extends BaseController
|
||||
@ResponseBody
|
||||
public TableDataInfo list(Company company)
|
||||
{
|
||||
getUserId();
|
||||
startPage();
|
||||
// 运营者账号,只能查询所属商户数据
|
||||
if(UserConstants.USER_TYPE_02 .equals(getSysUser().getUserType())){
|
||||
@ -124,32 +125,6 @@ public class CompanyController extends BaseController
|
||||
}
|
||||
company.setCreateBy(getLoginName());
|
||||
int flag = companyService.insertCompany(company);
|
||||
if(flag > 0) {
|
||||
// 创建运营商成功,添加运营商账号
|
||||
SysUser user = new SysUser();
|
||||
user.setSalt("");
|
||||
String password = UserConstants.DEFAULT_PASSWORD;
|
||||
user.setLoginName(company.getPhone());
|
||||
user.setUserName(company.getCompanyName());
|
||||
user.setUserType(UserConstants.USER_TYPE_02);
|
||||
user.setPhonenumber(company.getPhone());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), password, user.getSalt()));
|
||||
//所属区域转换省市县乡村组字段
|
||||
Zoning zoning = areaHnService.getAreaSuperior(company.getCitys());
|
||||
user.setCityCode(zoning.getCityCode());
|
||||
user.setCityName(zoning.getCityName());
|
||||
user.setDistrictCode(zoning.getDistrictCode());
|
||||
user.setDistrictName(zoning.getDistrictName());
|
||||
user.setTownCode(zoning.getTownCode());
|
||||
user.setTownName(zoning.getTownName());
|
||||
user.setCreateBy(getLoginName());
|
||||
user.setCreateTime(DateUtils.getNowDate());
|
||||
user.setUpdateTime(DateUtils.getNowDate());
|
||||
user.setStatus("0");
|
||||
user.setCreateById(getUserId());
|
||||
user.setGroupId(company.getId());
|
||||
userService.insertUser(user);
|
||||
}
|
||||
return toAjax(flag);
|
||||
}
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ public class CompanyStoreController extends BaseController
|
||||
CompanyStore companyStore = companyStoreService.selectCompanyStoreById(id);
|
||||
mmap.put("companyStore", companyStore);
|
||||
|
||||
List<ZcBaseUser> zcBaseUserList = zcBaseUserService.selectZcBaseUserByStoreId(id);
|
||||
List<ZcBaseUser> zcBaseUserList = zcBaseUserService.selectZcBaseUserByStoreId(id,null);
|
||||
mmap.put("zcBaseUserList", zcBaseUserList);
|
||||
return prefix + "/addStoreUser";
|
||||
}
|
||||
|
||||
@ -5,10 +5,15 @@ import java.util.List;
|
||||
import com.ruoyi.common.constant.CompanyConstants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.exception.RRException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.operation.domain.CompanyStore;
|
||||
import com.ruoyi.operation.service.ICompanyStoreService;
|
||||
import com.ruoyi.system.domain.Zoning;
|
||||
import com.ruoyi.system.service.ISysAreaHnService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -32,6 +37,12 @@ public class CompanyServiceImpl implements ICompanyService
|
||||
private ISysUserService userService;
|
||||
@Autowired
|
||||
private ICompanyStoreService companyStoreService;
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
@Autowired
|
||||
private ISysAreaHnService areaHnService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
/**
|
||||
* 查询运营商
|
||||
*
|
||||
@ -88,7 +99,38 @@ public class CompanyServiceImpl implements ICompanyService
|
||||
{
|
||||
company.setCreateTime(DateUtils.getNowDate());
|
||||
company.setUpdateTime(DateUtils.getNowDate());
|
||||
return companyMapper.insertCompany(company);
|
||||
int flag = companyMapper.insertCompany(company);
|
||||
|
||||
if(flag > 0) {
|
||||
// 创建运营商成功,添加运营商账号
|
||||
SysUser user = new SysUser();
|
||||
user.setSalt("");
|
||||
String password = UserConstants.DEFAULT_PASSWORD;
|
||||
user.setLoginName(company.getPhone());
|
||||
user.setUserName(company.getCompanyName());
|
||||
user.setUserType(UserConstants.USER_TYPE_02);
|
||||
user.setPhonenumber(company.getPhone());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), password, user.getSalt()));
|
||||
//所属区域转换省市县乡村组字段
|
||||
Zoning zoning = areaHnService.getAreaSuperior(company.getCitys());
|
||||
user.setCityCode(zoning.getCityCode());
|
||||
user.setCityName(zoning.getCityName());
|
||||
user.setDistrictCode(zoning.getDistrictCode());
|
||||
user.setDistrictName(zoning.getDistrictName());
|
||||
user.setTownCode(zoning.getTownCode());
|
||||
user.setTownName(zoning.getTownName());
|
||||
user.setCreateBy(ShiroUtils.getSysUser().getLoginName());
|
||||
user.setCreateTime(DateUtils.getNowDate());
|
||||
user.setUpdateTime(DateUtils.getNowDate());
|
||||
user.setStatus("0");
|
||||
user.setCreateById(ShiroUtils.getSysUser().getUserId());
|
||||
user.setGroupId(company.getId());
|
||||
// 新增运营商用户绑定运营商角色
|
||||
Long[] roleIds = {100L};
|
||||
user.setRoleIds(roleIds);
|
||||
userService.insertUser(user);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package com.ruoyi.orders.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.operation.domain.Company;
|
||||
import com.ruoyi.operation.service.ICompanyService;
|
||||
import com.ruoyi.orders.util.OrderStatusEnum;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@ -140,4 +143,20 @@ public class ZcOrderMainController extends BaseController
|
||||
{
|
||||
return toAjax(zcOrderMainService.deleteZcOrderMainByOrderIds(ids));
|
||||
}
|
||||
|
||||
@RequiresPermissions("orders:order:close")
|
||||
@Log(title = "结束订单", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/manualEndOrder")
|
||||
@ResponseBody
|
||||
public AjaxResult manualEndOrder(Long orderId)
|
||||
{
|
||||
ZcOrderMain zcOrderMain =new ZcOrderMain();
|
||||
zcOrderMain.setOrderId(orderId);
|
||||
zcOrderMain.setOrderStatus(OrderStatusEnum.MANUAL_END.getCode());
|
||||
zcOrderMain.setUpdateBy(getLoginName());
|
||||
zcOrderMain.setUpdateTime(DateUtils.getNowDate());
|
||||
|
||||
return toAjax(zcOrderMainService.updateManualEndOrder(zcOrderMain));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -58,4 +58,7 @@ public interface IZcOrderMainService
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteZcOrderMainByOrderId(Long orderId);
|
||||
|
||||
public int updateManualEndOrder(ZcOrderMain zcOrderMain);
|
||||
|
||||
}
|
||||
|
||||
@ -109,6 +109,12 @@ public class ZcOrderMainServiceImpl implements IZcOrderMainService
|
||||
return zcOrderMainMapper.deleteZcOrderMainByOrderId(orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateManualEndOrder(ZcOrderMain zcOrderMain) {
|
||||
//订单手动结束逻辑待完善
|
||||
return zcOrderMainMapper.updateZcOrderMain(zcOrderMain);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增租车子订单信息
|
||||
*
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.ruoyi.orders.util;
|
||||
|
||||
public enum OrderStatusEnum {
|
||||
WAIT_PAY("WAIT_PAY", "待支付"),
|
||||
WAIT_PICK("WAIT_PICK", "待取车"),
|
||||
RENT_ING("RENT_ING", "租赁中"),
|
||||
WAIT_RETURN("WAIT_RETURN", "待还车"),
|
||||
RENT_OVERDUE("RENT_OVERDUE", "逾期"),
|
||||
AUTO_END("AUTO_END", "自动结束"),
|
||||
MANUAL_END("MANUAL_END", "手动结束");
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
OrderStatusEnum(String code, String info) {
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
@ -15,6 +15,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.ruoyi.common.exception.RRException;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||
import com.ruoyi.common.utils.oss.OssService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.system.domain.CommonAttachment;
|
||||
import com.ruoyi.system.domain.SysAreaHn;
|
||||
@ -58,6 +59,10 @@ public class CommonController
|
||||
@Autowired
|
||||
private ISysAreaHnService sysAreaHnService;
|
||||
|
||||
// 在类中添加 OSS 服务注入
|
||||
@Autowired
|
||||
private OssService ossService;
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
@GetMapping("/area")
|
||||
@ -278,17 +283,33 @@ public class CommonController
|
||||
{
|
||||
try
|
||||
{
|
||||
/** oss --------------- */
|
||||
// // 检查文件是否为空
|
||||
// if (file.isEmpty()) {
|
||||
// return AjaxResult.error("上传文件不能为空");
|
||||
// }
|
||||
//
|
||||
// // 检查文件类型(可选)
|
||||
// String contentType = file.getContentType();
|
||||
// if (contentType == null || !contentType.startsWith("image/")) {
|
||||
// return AjaxResult.error("只允许上传图片文件");
|
||||
// }
|
||||
//
|
||||
// // 上传到 OSS
|
||||
// String url = ossService.uploadImage(file);
|
||||
// // 返回文件访问 URL
|
||||
// String[] str = url.split("/");
|
||||
// String fileName = str[str.length - 1];
|
||||
|
||||
/** 原文件上传 --------------- */
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, fileType, file);
|
||||
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
|
||||
// String url = serverConfig.getUrl() + "/common/newDownload?uuid=" + uuid;
|
||||
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
|
||||
/** -------------------------- */
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
CommonAttachment insert = new CommonAttachment();
|
||||
insert.setUuid(uuid);
|
||||
insert.setDataId(dataId);
|
||||
@ -308,6 +329,7 @@ public class CommonController
|
||||
ajax.put("url", url);
|
||||
ajax.put("uuid", uuid);
|
||||
return ajax;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -391,4 +413,35 @@ public class CommonController
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* OSS 图片上传请求
|
||||
*/
|
||||
@PostMapping("/ossUpload")
|
||||
@ResponseBody
|
||||
public AjaxResult ossUpload(@RequestParam("file") MultipartFile file) {
|
||||
try {
|
||||
// 检查文件是否为空
|
||||
if (file.isEmpty()) {
|
||||
return AjaxResult.error("上传文件不能为空");
|
||||
}
|
||||
|
||||
// 检查文件类型(可选)
|
||||
String contentType = file.getContentType();
|
||||
if (contentType == null || !contentType.startsWith("image/")) {
|
||||
return AjaxResult.error("只允许上传图片文件");
|
||||
}
|
||||
|
||||
// 上传到 OSS
|
||||
String url = ossService.uploadImage(file);
|
||||
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", file.getOriginalFilename());
|
||||
ajax.put("fileSize", file.getSize());
|
||||
return ajax;
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("上传失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -75,6 +75,10 @@ public class SysUserController extends BaseController
|
||||
public TableDataInfo list(SysUser user)
|
||||
{
|
||||
startPage();
|
||||
// 运营者账号,只能查询所属商户数据
|
||||
if(UserConstants.USER_TYPE_02.equals(getSysUser().getUserType())){
|
||||
user.setGroupId(getSysUser().getGroupId());
|
||||
}
|
||||
List<SysUser> list = userService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -82,3 +82,4 @@ renren:
|
||||
# token有效时长,7天,单位秒
|
||||
expire: 604800
|
||||
header: token
|
||||
|
||||
|
||||
@ -148,3 +148,12 @@ csrf:
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
|
||||
# 阿里云 OSS 配置
|
||||
aliyun:
|
||||
oss:
|
||||
endpoint: oss-cn-shanghai.aliyuncs.com
|
||||
accessKeyId: LTAI5tFZygsWsFqAqUbBmCrB
|
||||
accessKeySecret: n417ym6PZyq5Gc4NHHps3EwzNiClDJ
|
||||
bucketName: sczx-car-rental # 需要你提供具体的 bucket 名称
|
||||
domain: car-rental.sczxnet.com
|
||||
|
||||
@ -42,19 +42,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select id, user_name, avatar_url, password, phone_number, role_id, is_store, nick_name, wechat_openid, alipay_userid, del_flag, create_time, update_time from zc_base_user
|
||||
</sql>
|
||||
|
||||
<select id="selectZcBaseUserList" parameterType="ZcBaseUser" resultMap="ZcBaseUserResult">
|
||||
<include refid="selectZcBaseUserVo"/>
|
||||
<select id="selectZcBaseUserList" parameterType="ZcBaseUser" resultMap="ZcBaseUserZcBaseUserStoreResult">
|
||||
|
||||
select a.id, a.user_name, a.avatar_url, a.password, a.phone_number, a.role_id, a.is_store, a.nick_name, a.wechat_openid, a.alipay_userid, a.del_flag, a.create_time, a.update_time,
|
||||
b.id as sub_id, b.user_id as sub_user_id, b.operator_id as sub_operator_id, b.store_id as sub_store_id, b.create_time as sub_create_time
|
||||
from zc_base_user a
|
||||
left join zc_base_user_store b on b.user_id = a.id
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="avatarUrl != null and avatarUrl != ''"> and avatar_url = #{avatarUrl}</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
|
||||
<if test="roleId != null "> and role_id = #{roleId}</if>
|
||||
<if test="isStore != null "> and is_store = #{isStore}</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="wechatOpenid != null and wechatOpenid != ''"> and wechat_openid = #{wechatOpenid}</if>
|
||||
<if test="alipayUserid != null and alipayUserid != ''"> and alipay_userid = #{alipayUserid}</if>
|
||||
a.del_flag = '0'
|
||||
<if test="userName != null and userName != ''"> and a.user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="avatarUrl != null and avatarUrl != ''"> and a.avatar_url = #{avatarUrl}</if>
|
||||
<if test="password != null and password != ''"> and a.password = #{password}</if>
|
||||
<if test="phoneNumber != null and phoneNumber != ''"> and a.phone_number = #{phoneNumber}</if>
|
||||
<if test="roleId != null "> and a.role_id = #{roleId}</if>
|
||||
<if test="isStore != null "> and a.is_store = #{isStore}</if>
|
||||
<if test="nickName != null and nickName != ''"> and a.nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="wechatOpenid != null and wechatOpenid != ''"> and a.wechat_openid = #{wechatOpenid}</if>
|
||||
<if test="alipayUserid != null and alipayUserid != ''"> and a.alipay_userid = #{alipayUserid}</if>
|
||||
<if test="storeId != null "> and b.store_id = #{storeId}</if>
|
||||
<if test="operatorId != null "> and b.operator_id = #{operatorId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -63,7 +69,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
b.id as sub_id, b.user_id as sub_user_id, b.operator_id as sub_operator_id, b.store_id as sub_store_id, b.create_time as sub_create_time
|
||||
from zc_base_user a
|
||||
left join zc_base_user_store b on b.user_id = a.id
|
||||
where a.del_flag = '0' and b.store_id = #{storeId}
|
||||
where a.del_flag = '0'
|
||||
<if test="storeId != null "> and b.store_id = #{storeId}</if>
|
||||
<if test="operatorId != null "> and b.operator_id = #{operatorId}</if>
|
||||
</select>
|
||||
|
||||
<select id="selectZcBaseUserById" parameterType="Long" resultMap="ZcBaseUserZcBaseUserStoreResult">
|
||||
|
||||
@ -104,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="storeName != null and storeName!= '' "> and s.name = #{storeName}</if>
|
||||
<if test="licensePlate != null and licensePlate!= '' "> and zc.license_plate = #{licensePlate}</if>
|
||||
</where>
|
||||
order by a.update_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectZcOrderMainByOrderId" parameterType="Long" resultMap="ZcOrderMainZcOrderSubResult">
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-order-edit" th:object="${zcOrderMain}">
|
||||
<h4 class="form-header h4">租车订单信息</h4>
|
||||
<input name="orderId" th:field="*{orderId}" type="hidden">
|
||||
<input id="orderId" name="orderId" th:field="*{orderId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label is-required">订单编号:</label>
|
||||
<div class="col-sm-4">
|
||||
@ -129,6 +129,8 @@
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
<br/>
|
||||
<button type="button" th:if="not (*{orderStatus} == 'AUTO_END' or *{orderStatus} == 'MANUAL_END')" class="btn btn-white btn-sm" onclick="manualEndOrder()">手动结束订单</i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -256,24 +258,23 @@
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function addRow() {
|
||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
||||
var row = {
|
||||
index: $.table.serialNumber(count),
|
||||
suborderNo: "",
|
||||
suborderType: "",
|
||||
amount: "",
|
||||
paymentMethod: "",
|
||||
vinBatteryNo: "",
|
||||
createdAt: "",
|
||||
paymentId: "",
|
||||
paidAt: "",
|
||||
remark: "",
|
||||
delFlag: "",
|
||||
createTime: "",
|
||||
updateTime: "",
|
||||
}
|
||||
sub.addRow(row);
|
||||
function manualEndOrder(){
|
||||
var orderId = $("#orderId").val();
|
||||
$.modal.confirm("确认手动结束该订单", function() {
|
||||
$.operate.post(prefix + "/manualEndOrder", { "orderId": orderId}, function(result) {
|
||||
if (result.code == web_status.SUCCESS) {
|
||||
$.modal.msgSuccess("操作成功");
|
||||
// 关闭当前弹窗
|
||||
$.modal.close();
|
||||
var parent = activeWindow();
|
||||
parent.$.table.refresh();
|
||||
|
||||
} else {
|
||||
$.modal.msgError(result.msg);
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@ -93,6 +93,7 @@
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('orders:order:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('orders:order:remove')}]];
|
||||
var closeFlag = [[${@permission.hasPermi('orders:order:close')}]];
|
||||
var orderStatusDatas = [[${@dict.getType('key_order_status')}]];
|
||||
var rentalTypeDatas = [[${@dict.getType('key_order_rental_type')}]];
|
||||
var depositFreeDatas = [[${@dict.getType('key_rent_deposit_free')}]];
|
||||
@ -244,21 +245,12 @@
|
||||
field: 'startRentTime',
|
||||
title: '开始计费时间',
|
||||
width: '160px'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '100px',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + ' btnOption" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.orderId + '\',1300,800)"><i class="fa fa-edit"></i>查看</a> ');
|
||||
//actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user