立即承租
This commit is contained in:
parent
8ddc1e2c24
commit
eb96ef8093
|
|
@ -55,4 +55,13 @@ public class BookCarController extends BaseController {
|
||||||
return bookCarService.deleteById(devInfo);
|
return bookCarService.deleteById(devInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询立即承租详情
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询立即承租详情")
|
||||||
|
@PostMapping("/getBookCarDetailByMaId")
|
||||||
|
public AjaxResult getBookCarDetailByMaId(@RequestBody BookCarInfoDto devInfo) {
|
||||||
|
return bookCarService.getBookCarDetailByMaId(devInfo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,4 +32,10 @@ public interface BookCarService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult deleteById(BookCarInfoDto devInfo);
|
AjaxResult deleteById(BookCarInfoDto devInfo);
|
||||||
|
/**
|
||||||
|
* 获取立即承租详情
|
||||||
|
* @param devInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult getBookCarDetailByMaId(BookCarInfoDto devInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import com.bonus.material.book.mapper.BookCarMapper;
|
||||||
import com.bonus.material.book.service.BookCarService;
|
import com.bonus.material.book.service.BookCarService;
|
||||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
import com.bonus.material.device.mapper.BmFileInfoMapper;
|
import com.bonus.material.device.mapper.BmFileInfoMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
@ -25,6 +26,7 @@ import java.util.stream.Collectors;
|
||||||
* @Author:liang.chao
|
* @Author:liang.chao
|
||||||
* @Date:2024/11/22 - 16:53
|
* @Date:2024/11/22 - 16:53
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class BookCarServiceImpl implements BookCarService {
|
public class BookCarServiceImpl implements BookCarService {
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -104,4 +106,31 @@ public class BookCarServiceImpl implements BookCarService {
|
||||||
return result > 0 ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
return result > 0 ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询立即承租详情
|
||||||
|
* @param devInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getBookCarDetailByMaId(BookCarInfoDto devInfo) {
|
||||||
|
log.info("查询立即承租详情{}",devInfo);
|
||||||
|
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||||
|
devInfo.setOrderUser(userId);
|
||||||
|
List<DevInfoVo> bookCarDetails = bookCarMapper.getBookCarDetails(devInfo);
|
||||||
|
return AjaxResult.success(bookCarDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String generateOrderNumber() {
|
||||||
|
// 获取当前时间戳(毫秒级)
|
||||||
|
long timestamp = System.currentTimeMillis();
|
||||||
|
// 生成一个 4 位的随机数(可以根据需要修改长度)
|
||||||
|
int randomPart = (int) (Math.random() * 10000);
|
||||||
|
// 组合时间戳和随机数
|
||||||
|
return timestamp + String.format("%04d", randomPart);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("Order Number: " + generateOrderNumber());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN book_car_detail bcd ON d.ma_id = bcd.ma_id
|
LEFT JOIN book_car_detail bcd ON d.ma_id = bcd.ma_id
|
||||||
LEFT JOIN ma_type mt ON d.type_id = mt.type_id and mt.del_flag = '0'
|
LEFT JOIN ma_type mt ON d.type_id = mt.type_id and mt.del_flag = '0'
|
||||||
where d.is_active = '1' and bcd.order_status = '0'
|
where d.is_active = '1' and bcd.order_status = '0'
|
||||||
|
<if test="maId != null and maId != ''">
|
||||||
|
and bcd.ma_id = #{maId}
|
||||||
|
</if>
|
||||||
|
<if test="orderUser != null and orderUser != ''">
|
||||||
|
and bcd.order_user = #{orderUser}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectDevInfoByMaId" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
<select id="selectDevInfoByMaId" resultType="com.bonus.material.device.domain.vo.DevInfoVo">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue