砂站运输量统计
parent
4e07bb9cfe
commit
43a6c8d5b1
|
|
@ -8,6 +8,7 @@ import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
|||
import com.cowr.ssjygl.customer.CustomerPKValidator;
|
||||
import com.cowr.ssjygl.customer.CustomerService;
|
||||
import com.cowr.ssjygl.customer.CustomerValidator;
|
||||
import com.cowr.ssjygl.prepay.refunddetail.RefundDetailService;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.core.Controller;
|
||||
|
||||
|
|
@ -145,4 +146,9 @@ public class CustomerController extends Controller {
|
|||
public void list() {
|
||||
renderJson(Result.object(CustomerService.me.list()));
|
||||
}
|
||||
|
||||
public void getCustomerAccountBalance(){
|
||||
Integer customer_id = getInt("customer_id");
|
||||
renderJson(RefundDetailService.me.getCustomerAccountBalance(customer_id));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.cowr.service.ssjygl.invoice.invalidverify;
|
||||
|
||||
import com.cowr.common.enums.RoleEnum;
|
||||
import com.cowr.common.view.PageParam;
|
||||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.Sysuser;
|
||||
|
|
@ -36,7 +37,7 @@ public class InvoiceInvalidVerifyController extends Controller {
|
|||
if (tokenuser == null) {
|
||||
renderJson(Result.noauth());
|
||||
return;
|
||||
} else if (!SysuserSyncService.me.isTreasurer(tokenuser.getRole())) { // 财务才能审核
|
||||
} else if (!SysuserSyncService.me.isTreasurer(tokenuser.getRole())&&!SysuserSyncService.me.isPresident(tokenuser.getRole())) { // 财务/结算中心才能审核
|
||||
renderJson(Result.permissionDenied());
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,9 +48,12 @@ public class AuthInterceptor implements Interceptor {
|
|||
|
||||
add("/customer/get");
|
||||
add("/customer/edit");
|
||||
add("/customer/getCustomerAccountBalance");
|
||||
|
||||
add("/sysuser/edit");
|
||||
add("/sysuser/modpwd");
|
||||
add("/sysuser/modpwd");
|
||||
|
||||
}});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1320,8 +1320,8 @@ public class OrderclusterSyncService extends BaseSyncService {
|
|||
public Map getMaximumConfiguration( int customer_id,String unit_price){
|
||||
Map result=new HashMap();
|
||||
Integer count = Db.queryInt("select count(distinct s.name) from ordercluster t \n" +
|
||||
" left join supermarket s on s.id = t.supermarket_id \n" +
|
||||
" where t.customer_id =?", customer_id);
|
||||
" join supermarket s on s.id = t.supermarket_id \n" +
|
||||
" where t.state<5 and t.customer_id =?", customer_id);
|
||||
result.put("count",count);
|
||||
//当前用户如果只在一个沙场里面买沙,就计算最大可购买重量
|
||||
if(count<=1){
|
||||
|
|
|
|||
|
|
@ -6,19 +6,23 @@ import com.cowr.common.enums.Enums;
|
|||
import com.cowr.common.view.Result;
|
||||
import com.cowr.model.*;
|
||||
import com.cowr.service.ssjygl.base.BaseSyncService;
|
||||
import com.cowr.service.ssjygl.order.ordercluster.OrderclusterSyncService;
|
||||
import com.cowr.service.ssjygl.sms.log.SmsService;
|
||||
import com.cowr.service.ssjygl.synctask.SyncTaskService;
|
||||
import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
||||
import com.cowr.ssjygl.modifylog.ModifyLogService;
|
||||
import com.cowr.ssjygl.order.ordercluster.OrderclusterService;
|
||||
import com.cowr.ssjygl.prepay.prepaycustomer.PrepayCustomerService;
|
||||
import com.jfinal.kit.StrKit;
|
||||
import com.jfinal.log.Log;
|
||||
import com.jfinal.plugin.activerecord.Db;
|
||||
import com.jfinal.plugin.activerecord.IAtom;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class RefundDetailSyncService extends BaseSyncService {
|
||||
public static RefundDetailSyncService me = new RefundDetailSyncService();
|
||||
|
|
@ -32,7 +36,8 @@ public class RefundDetailSyncService extends BaseSyncService {
|
|||
if (customer == null) {
|
||||
return Result.failed("按客户 id 未找到对应客户信息");
|
||||
}
|
||||
|
||||
//取消订单
|
||||
cancelOrder( customer_id, user);
|
||||
PrepayCustomer prepayCustomer = PrepayCustomerService.me.getPrepayCustomer(customer.getId());
|
||||
|
||||
if (prepayCustomer == null) {
|
||||
|
|
@ -95,6 +100,21 @@ public class RefundDetailSyncService extends BaseSyncService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消订单
|
||||
* @param customer_id
|
||||
*/
|
||||
public void cancelOrder(Integer customer_id,Sysuser user){
|
||||
List<Record> recordList = OrderclusterService.me.getUncompletedOrdersFromUsers(customer_id);
|
||||
if (recordList!=null && !recordList.isEmpty()) {
|
||||
for (Record record : recordList) {
|
||||
Integer id = record.getInt("id");
|
||||
OrderclusterSyncService.me.complete(id, user);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核退费记录
|
||||
* 审核通过后,才由财务退款,财务退款后,才更新客户余额
|
||||
|
|
|
|||
|
|
@ -12,8 +12,11 @@ import com.cowr.model.Sysuser;
|
|||
import com.cowr.service.ssjygl.system.sysuser.SysuserSyncService;
|
||||
import com.cowr.ssjygl.stat.sale.OrderStatService;
|
||||
import com.jfinal.aop.Before;
|
||||
import com.jfinal.plugin.activerecord.Record;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OrderStatController extends BaseController {
|
||||
|
||||
/**
|
||||
|
|
@ -391,4 +394,19 @@ public class OrderStatController extends BaseController {
|
|||
render(new ExcelRender("按砂站总销售汇总表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 各砂站运输量统计表
|
||||
*/
|
||||
public void trafficStatisticsOfEachSandStation(){
|
||||
String stm=get("stm");
|
||||
String etm=get("etm");
|
||||
int export = getInt("export", 0); // 是否导出为exce 0 不导出,1 导出
|
||||
if (export == 0) {
|
||||
renderJson(Result.object(OrderStatService.me.trafficStatisticsOfEachSandStation(stm, etm)));
|
||||
}else {
|
||||
Workbook wb = OrderStatService.me.trafficStatisticsOfEachSandStationExport(stm, etm);
|
||||
render(new ExcelRender("各砂站运输量统计表_" + System.currentTimeMillis() + ".xlsx", wb));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue