|
@@ -81,7 +81,7 @@ public class TOrderController {
|
|
|
@Autowired
|
|
|
SzwlFeign szwlFeign;
|
|
|
@GetMapping("/pageOrder")
|
|
|
- public ResponseModel<IPage<?>> pageOrder(String adminId,String adminType,String type,String userName,String payType,String productNo,String clientId,String dateType, Date stratDate, Date endDate, long current, long size ) {
|
|
|
+ public ResponseModel<IPage<?>> pageOrder(String adminId,String adminType,String type,String userName,String payType,String productNo,String clientId,String dateType, Date startDate, Date endDate, long current, long size ) {
|
|
|
//判断当前账号状态
|
|
|
TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdmin(adminId));
|
|
|
//类型
|
|
@@ -118,7 +118,7 @@ public class TOrderController {
|
|
|
//判断当前账号状态 公司还是商家
|
|
|
if(admin.getType()>1){
|
|
|
//商家 判断是否子账户
|
|
|
- if(admin.getIsAdmined().equals("0")){
|
|
|
+ if(admin.getIsAdmined()){
|
|
|
//商家自己
|
|
|
query.eq(TOrder::getAdminId,adminId);
|
|
|
}else {
|
|
@@ -162,15 +162,15 @@ public class TOrderController {
|
|
|
if(StringUtils.isNotEmpty(dateType)){
|
|
|
if(dateType.equals("0")){
|
|
|
//创建时间
|
|
|
- if(stratDate!=null&&endDate!=null){
|
|
|
- query.gt(TOrder::getCreateDate,stratDate);
|
|
|
+ if(startDate!=null&&endDate!=null){
|
|
|
+ query.gt(TOrder::getCreateDate,startDate);
|
|
|
query.lt(TOrder::getCreateDate,endDate);
|
|
|
}
|
|
|
}
|
|
|
if(dateType.equals("1")){
|
|
|
//退款时间
|
|
|
- if(stratDate!=null&&endDate!=null){
|
|
|
- query.gt(TOrder::getRefundDate,stratDate);
|
|
|
+ if(startDate!=null&&endDate!=null){
|
|
|
+ query.gt(TOrder::getRefundDate,startDate);
|
|
|
query.lt(TOrder::getRefundDate,endDate);
|
|
|
}
|
|
|
}
|
|
@@ -185,7 +185,7 @@ public class TOrderController {
|
|
|
LambdaQueryWrapper<TCoinOrder> query = Wrappers.lambdaQuery();
|
|
|
//adminType="all"时,代表查全部下级 子账户没有这个权限 公司人员默认查所有人
|
|
|
if(StringUtils.isNotEmpty(adminType)){
|
|
|
- if(admin.getIsAdmined().equals("0")&&admin.getType()>1){
|
|
|
+ if(admin.getIsAdmined()&&admin.getType()>1){
|
|
|
if(admin.getType()>1){
|
|
|
if(adminType.equals("all")){
|
|
|
//查找所有下级
|
|
@@ -213,7 +213,7 @@ public class TOrderController {
|
|
|
//判断当前账号状态 公司还是商家
|
|
|
if(admin.getType()>1){
|
|
|
//商家 判断是否子账户
|
|
|
- if(admin.getIsAdmined().equals("0")){
|
|
|
+ if(admin.getIsAdmined()){
|
|
|
//商家自己
|
|
|
query.eq(TCoinOrder::getAdminId,adminId);
|
|
|
}else {
|
|
@@ -254,8 +254,8 @@ public class TOrderController {
|
|
|
query.eq(TCoinOrder::getClientId,equipment.getClientId());
|
|
|
}
|
|
|
}
|
|
|
- if(stratDate!=null&&endDate!=null){
|
|
|
- query.gt(TCoinOrder::getPayDate,stratDate);
|
|
|
+ if(startDate!=null&&endDate!=null){
|
|
|
+ query.gt(TCoinOrder::getPayDate,startDate);
|
|
|
query.lt(TCoinOrder::getPayDate,endDate);
|
|
|
}
|
|
|
Page<TCoinOrder> page = new Page<>(current, size, true);
|
|
@@ -395,8 +395,8 @@ public class TOrderController {
|
|
|
//查去年的数据找数据库
|
|
|
String endDate = param.getEndDate();
|
|
|
String toYear = "2022-01-01 00:00:00";
|
|
|
- Date date = new Date();
|
|
|
- Date year = new Date();
|
|
|
+ Date date =null;
|
|
|
+ Date year = null;
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
try {
|
|
|
//使用SimpleDateFormat的parse()方法生成Date
|
|
@@ -608,32 +608,28 @@ public class TOrderController {
|
|
|
*/
|
|
|
@ApiOperation(value = "订单数据导出-查询")
|
|
|
@RequestMapping(value = "/orderSelect", method = RequestMethod.GET)
|
|
|
- public String orderSelect(String type, String clientId, String username, String beginEndDate, long current, long size) {
|
|
|
+ public String orderSelect(String type, String clientId, String username, Date startDate, Date endDate, long current, long size) {
|
|
|
if(size>50){
|
|
|
return "error";
|
|
|
}
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
- if (!StringUtils.isEmpty(beginEndDate)) {
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ if (startDate!=null&&endDate!=null) {
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
|
Date begin = null;
|
|
|
Date end = null;
|
|
|
Long adminId = null;
|
|
|
- try {
|
|
|
- begin = simpleDateFormat.parse(beginEndDate.split(" - ")[0].trim());
|
|
|
- end = simpleDateFormat.parse(beginEndDate.split(" - ")[1].trim());
|
|
|
- long time = end.getTime() - begin.getTime();
|
|
|
- if(time>31*24*60*60*1000l){
|
|
|
- return "error";
|
|
|
- }
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
+ begin = startDate;
|
|
|
+ end = endDate;
|
|
|
+ long time = end.getTime() - begin.getTime();
|
|
|
+ if(time>31*24*60*60*1000l){
|
|
|
+ return "时间跨度过长";
|
|
|
}
|
|
|
if(!StringUtils.isEmpty(username)){
|
|
|
TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdminByUsername(username));
|
|
|
adminId = admin.getId();
|
|
|
}
|
|
|
- List<OrderDaoChuDTO> OrderDaoChuDTOList =orderService.orderDaoChu(begin,end,adminId,clientId,type,current,size);
|
|
|
+ List<OrderDaoChuDTO> OrderDaoChuDTOList =orderService.orderDaoChu(simpleDateFormat.format(begin),simpleDateFormat.format(end),adminId,clientId,type,current,size);
|
|
|
for(OrderDaoChuDTO orderDaoChuDTO: OrderDaoChuDTOList){
|
|
|
String adminId1 = orderDaoChuDTO.getAdminId().toString();
|
|
|
TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdmin(adminId1));
|
|
@@ -683,30 +679,26 @@ public class TOrderController {
|
|
|
*/
|
|
|
@ApiOperation(value = "订单数据导出-导出")
|
|
|
@RequestMapping(value = "/orderExport", method = RequestMethod.GET)
|
|
|
- public Object orderExport(HttpServletResponse response, String type, String clientId, String username, String beginEndDate, long current, long size) {
|
|
|
+ public Object orderExport(HttpServletResponse response, String type, String clientId, String username, Date startDate, Date endDate, long current, long size) {
|
|
|
if(size>500){
|
|
|
return JsonMessage.success("页数过大");
|
|
|
}
|
|
|
- if (!StringUtils.isEmpty(beginEndDate)) {
|
|
|
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ if (startDate!=null&&endDate!=null) {
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
|
Date begin = null;
|
|
|
Date end = null;
|
|
|
Long adminId = null;
|
|
|
- try {
|
|
|
- begin = simpleDateFormat.parse(beginEndDate.split(" - ")[0].trim());
|
|
|
- end = simpleDateFormat.parse(beginEndDate.split(" - ")[1].trim());
|
|
|
+ begin = startDate;
|
|
|
+ end = endDate;
|
|
|
long time = end.getTime() - begin.getTime();
|
|
|
if(time>31*24*60*60*1000l){
|
|
|
return JsonMessage.success("时间跨度过长");
|
|
|
}
|
|
|
- } catch (ParseException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
if(!StringUtils.isEmpty(username)){
|
|
|
TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdminByUsername(username));
|
|
|
adminId = admin.getId();
|
|
|
}
|
|
|
- List<OrderDaoChuDTO> OrderDaoChuDTOList =orderService.orderDaoChu(begin,end,adminId,clientId,type,current,size);
|
|
|
+ List<OrderDaoChuDTO> OrderDaoChuDTOList =orderService.orderDaoChu(simpleDateFormat.format(begin),simpleDateFormat.format(end),adminId,clientId,type,current,size);
|
|
|
for(OrderDaoChuDTO orderDaoChuDTO: OrderDaoChuDTOList){
|
|
|
Long adminId1 = Long.valueOf(orderDaoChuDTO.getAdminId().toString());
|
|
|
TAdmin admin = R.getDataIfSuccess(szwlFeign.getAdmin(adminId1.toString()));
|
|
@@ -805,7 +797,7 @@ public class TOrderController {
|
|
|
LambdaQueryWrapper<TOrder> query = Wrappers.lambdaQuery();
|
|
|
//adminType="all"时,代表查全部下级 子账户没有这个权限 公司人员默认查所有人
|
|
|
if(StringUtils.isNotEmpty(adminType)){
|
|
|
- if(admin.getIsAdmined().equals("0")&&admin.getType()>1){
|
|
|
+ if(admin.getIsAdmined()&&admin.getType()>1){
|
|
|
if(admin.getType()>1){
|
|
|
if(adminType.equals("all")){
|
|
|
//查找所有下级
|
|
@@ -833,7 +825,7 @@ public class TOrderController {
|
|
|
//判断当前账号状态 公司还是商家
|
|
|
if(admin.getType()>1){
|
|
|
//商家 判断是否子账户
|
|
|
- if(admin.getIsAdmined().equals("0")){
|
|
|
+ if(admin.getIsAdmined()){
|
|
|
//商家自己
|
|
|
query.eq(TOrder::getAdminId,adminId);
|
|
|
}else {
|
|
@@ -925,7 +917,7 @@ public class TOrderController {
|
|
|
LambdaQueryWrapper<TCoinOrder> query = Wrappers.lambdaQuery();
|
|
|
//adminType="all"时,代表查全部下级 子账户没有这个权限 公司人员默认查所有人
|
|
|
if(StringUtils.isNotEmpty(adminType)){
|
|
|
- if(admin.getIsAdmined().equals("0")&&admin.getType()>1){
|
|
|
+ if(admin.getIsAdmined()&&admin.getType()>1){
|
|
|
if(admin.getType()>1){
|
|
|
if(adminType.equals("all")){
|
|
|
//查找所有下级
|
|
@@ -953,7 +945,7 @@ public class TOrderController {
|
|
|
//判断当前账号状态 公司还是商家
|
|
|
if(admin.getType()>1){
|
|
|
//商家 判断是否子账户
|
|
|
- if(admin.getIsAdmined().equals("0")){
|
|
|
+ if(admin.getIsAdmined()){
|
|
|
//商家自己
|
|
|
query.eq(TCoinOrder::getAdminId,adminId);
|
|
|
}else {
|