Compare commits
No commits in common. "fb57b9e9f92a074fdd16e8aeceb969192ac518ec" and "2549dcd977ed1cab382fb0f99a7a89d7ad9c25a2" have entirely different histories.
fb57b9e9f9
...
2549dcd977
|
|
@ -76,19 +76,17 @@ public class CustomerController extends BaseController {
|
|||
startPage();
|
||||
List<Customer> list = customerService.getCustomerList(customer);
|
||||
for (Customer curCustomer: list) {
|
||||
Long teamNum = 0L;
|
||||
List<Long> customerIds = new ArrayList<Long>(){{
|
||||
add(curCustomer.getCustomerId());
|
||||
}};
|
||||
List<Long> nextLevelCustomerIds = new ArrayList<>();
|
||||
if (customer.getIsDistributor()) {
|
||||
// 分销商需要查询所有下一级分销用户作为统计条件
|
||||
Customer customerQry = new Customer();
|
||||
customerQry.setCustomerPlace(curCustomer.getCustomerId());
|
||||
customerQry.setStatus(Integer.valueOf(UserStatus.OK.getCode()));
|
||||
List<Customer> nextLevelCustomers = customerService.getCustomerList(customerQry);
|
||||
teamNum = teamNum + nextLevelCustomers.stream().filter(x->PlaceStatus.CAN_PLACE.getCode().equals(x.getPlaceStatus())).count();
|
||||
nextLevelCustomerIds = nextLevelCustomers.stream().map(Customer::getCustomerId).collect(Collectors.toList());
|
||||
List<Long> nextLevelCustomerIds = nextLevelCustomers.stream().map(Customer::getCustomerId).collect(Collectors.toList());
|
||||
customerIds.addAll(nextLevelCustomerIds);
|
||||
}
|
||||
|
||||
// 本月第一天
|
||||
|
|
@ -109,36 +107,30 @@ public class CustomerController extends BaseController {
|
|||
.setValue(customerService.countCustomer(customerParams));
|
||||
analyseItems.add(aItem1);
|
||||
// 本月绑定客户数
|
||||
customerParams.setPlaceStatus(null);
|
||||
customerParams.setUpdateTimeStart(firstDayCurMonth.atStartOfDay());
|
||||
AnalyseItem aItem2 = new AnalyseItem()
|
||||
.setType(AnalyseItemEnum.CUSTOMER_NUM_ADDED_CUR_MONTH.getType())
|
||||
.setTitle(AnalyseItemEnum.CUSTOMER_NUM_ADDED_CUR_MONTH.getTitle())
|
||||
.setUnit(AnalyseItemEnum.CUSTOMER_NUM_ADDED_CUR_MONTH.getUnit())
|
||||
.setValue(customerService.countCustomer(customerParams));
|
||||
.setType(AnalyseItemEnum.CUSTOMER_NUM_ADDED_CUR_MONTH.getType())
|
||||
.setTitle(AnalyseItemEnum.CUSTOMER_NUM_ADDED_CUR_MONTH.getTitle())
|
||||
.setUnit(AnalyseItemEnum.CUSTOMER_NUM_ADDED_CUR_MONTH.getUnit())
|
||||
.setValue(customerService.countCustomer(customerParams));
|
||||
analyseItems.add(aItem2);
|
||||
// 团队
|
||||
customerParams.setUpdateTimeStart(null);
|
||||
customerParams.setPlaceStatus(PlaceStatus.CAN_PLACE.getCode());
|
||||
AnalyseItem aItem11 = new AnalyseItem()
|
||||
.setType(AnalyseItemEnum.TEAM_MEMBER_NUM.getType())
|
||||
.setTitle(AnalyseItemEnum.TEAM_MEMBER_NUM.getTitle())
|
||||
.setUnit(AnalyseItemEnum.TEAM_MEMBER_NUM.getUnit())
|
||||
.setValue(customerService.countCustomer(customerParams));
|
||||
.setType(AnalyseItemEnum.TEAM_MEMBER_NUM.getType())
|
||||
.setTitle(AnalyseItemEnum.TEAM_MEMBER_NUM.getTitle())
|
||||
.setUnit(AnalyseItemEnum.TEAM_MEMBER_NUM.getUnit())
|
||||
.setValue(aItem1.getValue());
|
||||
analyseItems.add(aItem11);
|
||||
// 本月绑定客户数
|
||||
customerParams.setUpdateTimeStart(firstDayCurMonth.atStartOfDay());
|
||||
customerParams.setPlaceStatus(PlaceStatus.CAN_PLACE.getCode());
|
||||
AnalyseItem aItem12 = new AnalyseItem()
|
||||
.setType(AnalyseItemEnum.TEAM_MEMBER_ADDED_CUR_MONTH.getType())
|
||||
.setTitle(AnalyseItemEnum.TEAM_MEMBER_ADDED_CUR_MONTH.getTitle())
|
||||
.setUnit(AnalyseItemEnum.TEAM_MEMBER_ADDED_CUR_MONTH.getUnit())
|
||||
.setValue(customerService.countCustomer(customerParams));
|
||||
.setValue(aItem2.getValue());
|
||||
analyseItems.add(aItem12);
|
||||
|
||||
// 本月订单数及本月订单额
|
||||
OrderMaster orderParams1 = new OrderMaster();
|
||||
customerIds.addAll(nextLevelCustomerIds);
|
||||
orderParams1.setCustomerIds(customerIds);
|
||||
orderParams1.setCreateTimeStart(firstDayCurMonth.atStartOfDay());
|
||||
List<OrderMaster> ordersCurMonth1 = orderMasterService.selectOrderMasterList(orderParams1);
|
||||
|
|
@ -220,7 +212,7 @@ public class CustomerController extends BaseController {
|
|||
OrderMaster orderParams4 = new OrderMaster();
|
||||
orderParams4.setCustomerIds(customerIds);
|
||||
orderParams4.setCreateTimeStart(firstDayCurWeek.atStartOfDay());
|
||||
List<OrderMaster> ordersCurWeek = orderMasterService.selectOrderMasterList(orderParams4);
|
||||
List<OrderMaster> ordersCurWeek = orderMasterService.selectOrderMasterList(orderParams3);
|
||||
List<Long> orderIdsCurWeek = ordersCurWeek.stream().map(OrderMaster::getId).collect(Collectors.toList());
|
||||
BigDecimal totalMoneyCurWeek = new BigDecimal(0);
|
||||
if (CollectionUtils.isNotEmpty(orderIdsCurWeek)) {
|
||||
|
|
|
|||
|
|
@ -664,15 +664,6 @@ public class OrderController extends BaseController {
|
|||
|
||||
// 分销扣点记录
|
||||
Long customerPlaceId = customer.getCustomerPlace();
|
||||
Long parentCustomerPlaceId = customer.getParentCustomerPlace();
|
||||
Long reparentCustomerPlaceId = null;
|
||||
if(customer.getParentCustomerPlace() != null){
|
||||
Customer parentPlaceCustomer =customerService.selectByCustomerId(customer.getParentCustomerPlace());
|
||||
if(parentPlaceCustomer != null){
|
||||
reparentCustomerPlaceId = parentPlaceCustomer.getCustomerPlace();
|
||||
}
|
||||
}
|
||||
|
||||
// 一级分销
|
||||
if (customerPlaceId != null) {
|
||||
FinancialDetail financialDetail = new FinancialDetail(deptId, financialDetailService.createCode(),
|
||||
|
|
@ -681,9 +672,12 @@ public class OrderController extends BaseController {
|
|||
|
||||
// 剩余服务金额
|
||||
serverMoney = serverMoney.subtract(threeMoney);
|
||||
} else {
|
||||
oneMoney = oneMoney.add(threeMoney);
|
||||
}
|
||||
|
||||
// 二级分销
|
||||
Long parentCustomerPlaceId = customer.getParentCustomerPlace();
|
||||
if (parentCustomerPlaceId != null) {
|
||||
FinancialDetail financialDetail = new FinancialDetail(deptId, financialDetailService.createCode(),
|
||||
financialMaster.getId(), financialMaster.getCode(), twoMoney, FinancialDetailType.PLACE_FEE.getCode(), parentCustomerPlaceId);
|
||||
|
|
@ -691,42 +685,17 @@ public class OrderController extends BaseController {
|
|||
|
||||
// 剩余服务金额
|
||||
serverMoney = serverMoney.subtract(twoMoney);
|
||||
}else if(customerPlaceId != null){
|
||||
// 二级没有,且三级有
|
||||
FinancialDetail financialDetail = new FinancialDetail(deptId, financialDetailService.createCode(),
|
||||
financialMaster.getId(), financialMaster.getCode(), twoMoney, FinancialDetailType.PLACE_FEE.getCode(), customerPlaceId);
|
||||
financialDetailService.insertFinancialDetail(financialDetail);
|
||||
|
||||
// 剩余服务金额
|
||||
serverMoney = serverMoney.subtract(twoMoney);
|
||||
} else {
|
||||
oneMoney = oneMoney.add(twoMoney);
|
||||
}
|
||||
|
||||
// 最上级分,没有则给下级,再没有再给下级
|
||||
if(reparentCustomerPlaceId != null){
|
||||
// 平台分销
|
||||
FinancialDetail financialDetail = new FinancialDetail(deptId, financialDetailService.createCode(),
|
||||
financialMaster.getId(), financialMaster.getCode(), oneMoney, FinancialDetailType.PLACE_FEE.getCode(), reparentCustomerPlaceId);
|
||||
financialDetailService.insertFinancialDetail(financialDetail);
|
||||
// 平台分销
|
||||
FinancialDetail financialDetail = new FinancialDetail(deptId, financialDetailService.createCode(),
|
||||
financialMaster.getId(), financialMaster.getCode(), oneMoney, FinancialDetailType.PLACE_FEE.getCode(), null);
|
||||
financialDetailService.insertFinancialDetail(financialDetail);
|
||||
|
||||
// 剩余服务金额
|
||||
serverMoney = serverMoney.subtract(oneMoney);
|
||||
}else if(parentCustomerPlaceId != null){
|
||||
// 平台分销
|
||||
FinancialDetail financialDetail = new FinancialDetail(deptId, financialDetailService.createCode(),
|
||||
financialMaster.getId(), financialMaster.getCode(), oneMoney, FinancialDetailType.PLACE_FEE.getCode(), parentCustomerPlaceId);
|
||||
financialDetailService.insertFinancialDetail(financialDetail);
|
||||
|
||||
// 剩余服务金额
|
||||
serverMoney = serverMoney.subtract(oneMoney);
|
||||
}else if(customerPlaceId != null){
|
||||
// 平台分销
|
||||
FinancialDetail financialDetail = new FinancialDetail(deptId, financialDetailService.createCode(),
|
||||
financialMaster.getId(), financialMaster.getCode(), oneMoney, FinancialDetailType.PLACE_FEE.getCode(), customerPlaceId);
|
||||
financialDetailService.insertFinancialDetail(financialDetail);
|
||||
|
||||
// 剩余服务金额
|
||||
serverMoney = serverMoney.subtract(oneMoney);
|
||||
}
|
||||
// 剩余服务金额
|
||||
serverMoney = serverMoney.subtract(oneMoney);
|
||||
|
||||
financialMaster.setServerMoney(serverMoney);
|
||||
financialMasterService.updateFinancialMaster(financialMaster);
|
||||
|
|
@ -1010,64 +979,63 @@ public class OrderController extends BaseController {
|
|||
// 查询子单
|
||||
OrderDetail orderDetailReq = new OrderDetail();
|
||||
BeanUtils.copyProperties(orderListRequest, orderDetailReq);
|
||||
// 拿到所有正常筛选出来的子单
|
||||
List<OrderListResponse> detailList = this.getDetailList(orderDetailReq);
|
||||
orderListResponses.addAll(detailList);
|
||||
// List<OrderListResponse> allList = new ArrayList<>();
|
||||
// List<Long> masterIdSet = new ArrayList<Long>();
|
||||
// if (orderListRequest.getTimeout() != null && orderListRequest.getTimeout() == 1) {
|
||||
// // 增加主单下子单有超时的
|
||||
// // 增加主单下子单有超时的
|
||||
// OrderMaster param = new OrderMaster();
|
||||
// param.setWorkerId(orderListRequest.getWorkerId());
|
||||
// List<OrderMaster> allOrderMaster = orderMasterService.selectOrderMasterList(param);
|
||||
// if(CollectionUtils.isNotEmpty(allOrderMaster)){
|
||||
// OrderDetail countParam = new OrderDetail();
|
||||
// countParam.setMasterIds(allOrderMaster.stream().map(OrderMaster::getId).collect(Collectors.toList()));
|
||||
// List<OrderDetail> orderDetails = orderDetailService.selectOrderDetailList(countParam);
|
||||
// List<OrderDetail> result = orderDetails.stream().filter(s -> s.getTimeout().equals(1)).collect(Collectors.toList());
|
||||
// if (CollectionUtils.isNotEmpty(result)) {
|
||||
// masterIdSet = result.stream().map(OrderDetail::getOrderMasterId).collect(Collectors.toList());
|
||||
// }
|
||||
// }
|
||||
// if (CollectionUtils.isNotEmpty(masterIdSet)) {
|
||||
// OrderMaster timeOutMaster = new OrderMaster();
|
||||
// timeOutMaster.setOrderMasterIdList(masterIdSet);
|
||||
// allList.addAll(this.getMasterList(timeOutMaster));
|
||||
// }
|
||||
// }
|
||||
List<OrderListResponse> allList = new ArrayList<>();
|
||||
List<Long> masterIdSet = new ArrayList<Long>();
|
||||
if (orderListRequest.getTimeout() != null && orderListRequest.getTimeout() == 1) {
|
||||
// 增加主单下子单有超时的
|
||||
// 增加主单下子单有超时的
|
||||
OrderMaster param = new OrderMaster();
|
||||
param.setWorkerId(orderListRequest.getWorkerId());
|
||||
List<OrderMaster> allOrderMaster = orderMasterService.selectOrderMasterList(param);
|
||||
if(CollectionUtils.isNotEmpty(allOrderMaster)){
|
||||
OrderDetail countParam = new OrderDetail();
|
||||
countParam.setMasterIds(allOrderMaster.stream().map(OrderMaster::getId).collect(Collectors.toList()));
|
||||
List<OrderDetail> orderDetails = orderDetailService.selectOrderDetailList(countParam);
|
||||
List<OrderDetail> result = orderDetails.stream().filter(s -> s.getTimeout().equals(1)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(result)) {
|
||||
masterIdSet = result.stream().map(OrderDetail::getOrderMasterId).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(masterIdSet)) {
|
||||
OrderMaster timeOutMaster = new OrderMaster();
|
||||
timeOutMaster.setOrderMasterIdList(masterIdSet);
|
||||
allList.addAll(this.getMasterList(timeOutMaster));
|
||||
}
|
||||
}
|
||||
|
||||
// 查询主单
|
||||
OrderMaster orderMasterReq = new OrderMaster();
|
||||
BeanUtils.copyProperties(orderListRequest, orderMasterReq);
|
||||
// orderMasterReq.setExceptOrderMasterIds(masterIdSet);
|
||||
orderMasterReq.setExceptOrderMasterIds(masterIdSet);
|
||||
orderMasterReq.setGoodsName(null);
|
||||
List<OrderListResponse> masterList = this.getMasterList(orderMasterReq);
|
||||
// allList.addAll(masterList);
|
||||
allList.addAll(masterList);
|
||||
// 超时查询需要排除同个师傅的主单子单同时出现
|
||||
// if (orderListRequest.getTimeout() != null && orderListRequest.getTimeout() == 1) {
|
||||
// // 需要排除同个师傅的主单子单同时出现
|
||||
// List<OrderListResponse> filteredMasterList = new ArrayList<OrderListResponse>();
|
||||
// for (OrderListResponse master : allList) {
|
||||
// boolean isKeep = false;
|
||||
// // 查询该主单下所有售后中的子单
|
||||
// OrderDetail detailAfterListOfMasterQry = new OrderDetail();
|
||||
// detailAfterListOfMasterQry.setOrderMasterCode(master.getOrderMasterCode());
|
||||
// List<OrderListResponse> detailListOfMasters = this.getDetailList(detailAfterListOfMasterQry);
|
||||
// for (OrderListResponse detailListOfMaster : detailListOfMasters) {
|
||||
// if (!detailListOfMaster.getWorkerId().equals(orderListRequest.getWorkerId())) {
|
||||
// isKeep = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (isKeep) {
|
||||
// filteredMasterList.add(master);
|
||||
// }
|
||||
// }
|
||||
// orderListResponses.addAll(filteredMasterList);
|
||||
// } else {
|
||||
if (orderListRequest.getTimeout() != null && orderListRequest.getTimeout() == 1) {
|
||||
// 需要排除同个师傅的主单子单同时出现
|
||||
List<OrderListResponse> filteredMasterList = new ArrayList<OrderListResponse>();
|
||||
for (OrderListResponse master : allList) {
|
||||
boolean isKeep = false;
|
||||
// 查询该主单下所有售后中的子单
|
||||
OrderDetail detailAfterListOfMasterQry = new OrderDetail();
|
||||
detailAfterListOfMasterQry.setOrderMasterCode(master.getOrderMasterCode());
|
||||
List<OrderListResponse> detailListOfMasters = this.getDetailList(detailAfterListOfMasterQry);
|
||||
for (OrderListResponse detailListOfMaster : detailListOfMasters) {
|
||||
if (!detailListOfMaster.getWorkerId().equals(orderListRequest.getWorkerId())) {
|
||||
isKeep = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isKeep) {
|
||||
filteredMasterList.add(master);
|
||||
}
|
||||
}
|
||||
orderListResponses.addAll(filteredMasterList);
|
||||
} else {
|
||||
orderListResponses.addAll(masterList);
|
||||
// }
|
||||
}
|
||||
|
||||
// 查询新订单列表根据创建时间倒叙排列,查询其他根据更新时间倒序排列
|
||||
Collections.sort(orderListResponses, new Comparator<OrderListResponse>() {
|
||||
|
|
@ -1117,11 +1085,7 @@ public class OrderController extends BaseController {
|
|||
break;
|
||||
}
|
||||
}
|
||||
long count = detailAfterListOfMasters.stream().filter(x->(x.getAfterTimeout()!=null && x.getAfterTimeout() == 1)).count();
|
||||
if (isKeep) {
|
||||
if(count > 0){
|
||||
master.setAfterTimeout(1);
|
||||
}
|
||||
filteredMasterList.add(master);
|
||||
}
|
||||
}
|
||||
|
|
@ -1403,7 +1367,6 @@ public class OrderController extends BaseController {
|
|||
orderListResponse.setCustomerRemark(orderMaster.getRemark());
|
||||
orderListResponse.setOrderType(detail.getOrderType());
|
||||
orderListResponse.setTimeout(detail.getTimeout());
|
||||
orderListResponse.setAfterTimeout(detail.getAfterTimeout());
|
||||
orderListResponse.setAfterServiceRecordList(detailRecordMap.get(detail.getId()));
|
||||
orderListResponse.setChangeMoney(changeMoney);
|
||||
orderListResponse.setDrawCashStatus(detail.getDrawCashStatus());
|
||||
|
|
@ -1697,7 +1660,6 @@ public class OrderController extends BaseController {
|
|||
orderListResponse.setOrderType(detail.getOrderType());
|
||||
orderListResponse.setTimeout(detail.getTimeout());
|
||||
orderListResponse.setTimeoutFineTimes(detail.getTimeoutFineTimes());
|
||||
orderListResponse.setAfterTimeout(detail.getAfterTimeout());
|
||||
orderListResponse.setChangeMoney(changeMoney);
|
||||
orderListResponse.setCreateTime(detail.getCreateTime());
|
||||
orderListResponse.setUpdateTime(detail.getUpdateTime());
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import com.ghy.system.service.IWxMsgService;
|
|||
import com.ghy.web.pojo.vo.OrderChangePriceRequest;
|
||||
import com.ghy.web.pojo.vo.OrderListResponse;
|
||||
import com.ghy.web.pojo.vo.OrderStandard;
|
||||
import com.ghy.web.service.InsuranceService;
|
||||
import com.ghy.worker.domain.Worker;
|
||||
import com.ghy.worker.domain.WorkerCertification;
|
||||
import com.ghy.worker.service.IWorkerCertificationService;
|
||||
|
|
@ -113,8 +112,6 @@ public class OrderDetailController extends BaseController {
|
|||
|
||||
@Resource
|
||||
private IInsuranceManagerService insuranceManagerService;
|
||||
@Autowired
|
||||
private InsuranceService insuranceService;
|
||||
|
||||
@RequiresPermissions("order:detail:view")
|
||||
@GetMapping()
|
||||
|
|
@ -127,18 +124,7 @@ public class OrderDetailController extends BaseController {
|
|||
@ResponseBody
|
||||
public TableDataInfo list(OrderDetail orderDetail) {
|
||||
if (orderDetail.getSearchAfterList() !=null && orderDetail.getSearchAfterList()) {
|
||||
List<?> rows = this.afterServiceList(orderDetail).getRows();
|
||||
StringBuilder detailIds = new StringBuilder();
|
||||
if(CollectionUtils.isNotEmpty(rows)){
|
||||
rows.forEach(model->{
|
||||
OrderListResponse response = (OrderListResponse)model;
|
||||
detailIds.append(response.getOrderDetailId()).append(",");
|
||||
});
|
||||
}
|
||||
String ids = detailIds.toString();
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(ids)) {
|
||||
orderDetail.setOrderDetailIds(ids.substring(0, ids.length() - 1));
|
||||
}
|
||||
return this.afterServiceList(orderDetail);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(orderDetail.getWorkerName()) || StringUtils.isNotEmpty(orderDetail.getWorkerPhone())){
|
||||
|
|
@ -946,13 +932,6 @@ public class OrderDetailController extends BaseController {
|
|||
if (StringUtils.isNotEmpty(orderDetail.getClockInLocation())) {
|
||||
OrderDetail model = orderDetailService.selectById(orderDetail.getId());
|
||||
Customer customer = customerService.selectByCustomerId(model.getCustomerId());
|
||||
// 更新订单状态为上门
|
||||
try {
|
||||
insuranceService.clockInsurance(model.getId());
|
||||
}catch (Exception e){
|
||||
logger.error("订单上门返回异常:{}", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 通知师傅新订单
|
||||
try {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -131,17 +131,6 @@ public class OrderMasterController extends BaseController {
|
|||
@Resource
|
||||
private IInsuranceManagerService insuranceManagerService;
|
||||
|
||||
@PostMapping("/orderInsurance")
|
||||
@ResponseBody
|
||||
public AjaxResult orderInsurance(@RequestParam(value = "orderCode") String orderCode){
|
||||
try {
|
||||
insuranceService.orderInsurance(orderCode);
|
||||
return AjaxResult.success();
|
||||
}catch (Exception e){
|
||||
return AjaxResult.error("保险未响应,请再次点击操作,或稍等再试【本单联通保险公司系统,操作此按键时开始投保,偶遇未响应,请间隔一两分钟再次点接单即可!】");
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/changePrice/{orderIds}")
|
||||
public String changePrice(@PathVariable("orderIds") String orderIds, ModelMap mmap)
|
||||
{
|
||||
|
|
@ -1161,8 +1150,6 @@ public class OrderMasterController extends BaseController {
|
|||
orderStandardDetail.setDrawCashStatus(orderDetail.getDrawCashStatus());
|
||||
orderStandardDetail.setDrawCashTime(orderDetail.getDrawCashTime());
|
||||
|
||||
orderStandardDetail.setAfterTimeout(orderDetail.getAfterTimeout());
|
||||
|
||||
orderStandardDetails.add(orderStandardDetail);
|
||||
}
|
||||
|
||||
|
|
@ -1303,18 +1290,7 @@ public class OrderMasterController extends BaseController {
|
|||
@ResponseBody
|
||||
public TableDataInfo list(OrderMaster orderMaster) {
|
||||
if (orderMaster.getSearchAfterList() !=null && orderMaster.getSearchAfterList()) {
|
||||
List<?> rows = this.afterList(orderMaster).getRows();
|
||||
StringBuilder masterIds = new StringBuilder();
|
||||
if(CollectionUtils.isNotEmpty(rows)){
|
||||
rows.forEach(model->{
|
||||
OrderListResponse response = (OrderListResponse)model;
|
||||
masterIds.append(response.getOrderMasterId()).append(",");
|
||||
});
|
||||
}
|
||||
String ids = masterIds.toString();
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(ids)) {
|
||||
orderMaster.setOrderMasterIds(ids.substring(0, ids.length() - 1));
|
||||
}
|
||||
return this.afterList(orderMaster);
|
||||
}
|
||||
|
||||
startPage();
|
||||
|
|
@ -1508,14 +1484,14 @@ public class OrderMasterController extends BaseController {
|
|||
// 下单
|
||||
if(orderMaster.getOrderStatus() != null && OrderStatus.PLAIN.code() == orderMaster.getOrderStatus()){
|
||||
OrderMaster model = orderMasterService.selectById(orderMaster.getId());
|
||||
// try {
|
||||
// if(model.getInsuranceId()!=null){
|
||||
// insuranceService.orderInsurance(model.getCode());
|
||||
// }
|
||||
// }catch (Exception e){
|
||||
// logger.error("下单报错:" + ExceptionUtils.getMessage(e));
|
||||
// return AjaxResult.error("保险正生成中,可能需几秒或几分钟,请稍等即可!若超半小时可联系发单方或平台!");
|
||||
// }
|
||||
try {
|
||||
if(model.getInsuranceId()!=null){
|
||||
insuranceService.orderInsurance(model.getCode());
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.error("下单报错:" + ExceptionUtils.getMessage(e));
|
||||
return AjaxResult.error("保险正生成中,可能需几秒或几分钟,请稍等即可!若超半小时可联系发单方或平台!");
|
||||
}
|
||||
// 判断是否是在线支付订单--如果是在线支付,且未付款,则需要提示支付后接单
|
||||
if(PayTypeEnum.WX_LITE.getCode().equals(model.getPayType())){
|
||||
// 查询财务信息
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ import com.ghy.common.enums.BusinessType;
|
|||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.common.utils.poi.ExcelUtil;
|
||||
import com.ghy.payment.domain.FinancialDetail;
|
||||
import com.ghy.payment.request.FinancialAccountBillReq;
|
||||
import com.ghy.payment.response.FinancialAccountBillResp;
|
||||
import com.ghy.payment.service.FinancialDetailService;
|
||||
import com.ghy.web.pojo.vo.FinancialCountRequest;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -70,14 +68,6 @@ public class FinancialDetailController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/app/listV2")
|
||||
@ResponseBody
|
||||
public TableDataInfo appListV2(@RequestBody FinancialAccountBillReq financialAccountBillReq) {
|
||||
startPage();
|
||||
List<FinancialAccountBillResp> list = financialDetailService.selectFinancialDetailListV2(financialAccountBillReq);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "财务细单管理", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("financial:detail:export")
|
||||
@PostMapping("/export")
|
||||
|
|
|
|||
|
|
@ -316,77 +316,73 @@ public class WxController extends BaseController {
|
|||
@GetMapping("/neCheck")
|
||||
@ResponseBody
|
||||
public AjaxResult neCheck(HttpServletRequest request) {
|
||||
try {
|
||||
String url;
|
||||
boolean flag = false;
|
||||
String deptId = request.getHeader("deptId");
|
||||
String from = request.getHeader("from");
|
||||
SysDeptConfig sysDeptConfig = sysDeptConfigService.selectByDeptId(Long.parseLong(deptId));
|
||||
String code = request.getHeader("code");
|
||||
if("customer".equals(from)){
|
||||
url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + sysDeptConfig.getWxAppId() + "&secret=" + sysDeptConfig.getWxSecret() + "&js_code=" + code + "&grant_type=authorization_code";
|
||||
}else {
|
||||
url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + sysDeptConfig.getServWxAppId() + "&secret=" + sysDeptConfig.getServWxSecret() + "&js_code=" + code + "&grant_type=authorization_code";
|
||||
}
|
||||
String data = HttpUtils.sendGet(url, null);
|
||||
JSONObject result = JSONObject.parseObject(data);
|
||||
// 如果是师傅端,需要调用公众号的获取用户列表接口 -- 遍历列表去找到unionId和openid关联并入库
|
||||
if(!"customer".equals(from)){
|
||||
String openid = result.getString("openid");
|
||||
String unionId = result.getString("unionid");
|
||||
// 查询openid是否入库,已经入库则不管
|
||||
Worker param = new Worker();
|
||||
param.setOpenId(openid);
|
||||
Worker worker = workerService.selectByOpenId(param);
|
||||
if(worker != null){
|
||||
// 公众号token
|
||||
String wxToken = WechatMsgUtils.getToken();
|
||||
String wxUserOpenidList = HttpUtils.sendGet("https://api.weixin.qq.com/cgi-bin/user/get?access_token="+wxToken+"&next_openid=");
|
||||
logger.info("公众号获取的用户列表集合:{}", wxUserOpenidList);
|
||||
JSONObject wxOpenidJson = JSONObject.parseObject(wxUserOpenidList);
|
||||
JSONObject openIdListJson = wxOpenidJson.getJSONObject("data");
|
||||
List<String> openidList = openIdListJson.getObject("openid", ArrayList.class);
|
||||
List<List<String>> batchList = ListUtil.partition(openidList, 99);
|
||||
for (List<String> childOpenidList : batchList) {
|
||||
JSONArray openidJsonArray = new JSONArray();
|
||||
childOpenidList.forEach(model->{
|
||||
JSONObject openidJson = new JSONObject();
|
||||
openidJson.put("openid", model);
|
||||
openidJson.put("lang", "zh_CN");
|
||||
openidJsonArray.add(openidJson);
|
||||
});
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
jsonParam.put("user_list", openidJsonArray);
|
||||
String unionUrl = "https://api.weixin.qq.com/cgi-bin/user/info/batchget?access_token="+WechatMsgUtils.getToken();;
|
||||
logger.info("调用获取用户信息,请求url:{}, 请求body:{}", unionUrl, jsonParam.toJSONString());
|
||||
String getUnionResult = HttpUtil.post(unionUrl, jsonParam.toJSONString());
|
||||
logger.info("获取公众号union列表:{}", getUnionResult);
|
||||
JSONObject unionJson = JSONObject.parseObject(getUnionResult);
|
||||
JSONArray unionJsonArray = unionJson.getJSONArray("user_info_list");
|
||||
for (int index = 0 ; index<unionJsonArray.size(); index ++){
|
||||
JSONObject json = unionJsonArray.getJSONObject(index);
|
||||
if(StringUtils.isNotEmpty(json.getString("unionid") )&& StringUtils.isNotEmpty(unionId)){
|
||||
if(json.getString("unionid").equals(unionId)){
|
||||
Worker updateWorker = new Worker();
|
||||
updateWorker.setWorkerId(worker.getWorkerId());
|
||||
updateWorker.setWxOpenId(json.getString("openid"));
|
||||
logger.info("关联后的worker信息:{}", worker);
|
||||
workerService.updateWorker(updateWorker);
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
String url;
|
||||
boolean flag = false;
|
||||
String deptId = request.getHeader("deptId");
|
||||
String from = request.getHeader("from");
|
||||
SysDeptConfig sysDeptConfig = sysDeptConfigService.selectByDeptId(Long.parseLong(deptId));
|
||||
String code = request.getHeader("code");
|
||||
if("customer".equals(from)){
|
||||
url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + sysDeptConfig.getWxAppId() + "&secret=" + sysDeptConfig.getWxSecret() + "&js_code=" + code + "&grant_type=authorization_code";
|
||||
}else {
|
||||
url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + sysDeptConfig.getServWxAppId() + "&secret=" + sysDeptConfig.getServWxSecret() + "&js_code=" + code + "&grant_type=authorization_code";
|
||||
}
|
||||
String data = HttpUtils.sendGet(url, null);
|
||||
JSONObject result = JSONObject.parseObject(data);
|
||||
// 如果是师傅端,需要调用公众号的获取用户列表接口 -- 遍历列表去找到unionId和openid关联并入库
|
||||
if(!"customer".equals(from)){
|
||||
String openid = result.getString("openid");
|
||||
String unionId = result.getString("unionid");
|
||||
// 查询openid是否入库,已经入库则不管
|
||||
Worker param = new Worker();
|
||||
param.setOpenId(openid);
|
||||
Worker worker = workerService.selectByOpenId(param);
|
||||
if(worker != null){
|
||||
// 公众号token
|
||||
String wxToken = WechatMsgUtils.getToken();
|
||||
String wxUserOpenidList = HttpUtils.sendGet("https://api.weixin.qq.com/cgi-bin/user/get?access_token="+wxToken+"&next_openid=");
|
||||
logger.info("公众号获取的用户列表集合:{}", wxUserOpenidList);
|
||||
JSONObject wxOpenidJson = JSONObject.parseObject(wxUserOpenidList);
|
||||
JSONObject openIdListJson = wxOpenidJson.getJSONObject("data");
|
||||
List<String> openidList = openIdListJson.getObject("openid", ArrayList.class);
|
||||
List<List<String>> batchList = ListUtil.partition(openidList, 99);
|
||||
for (List<String> childOpenidList : batchList) {
|
||||
JSONArray openidJsonArray = new JSONArray();
|
||||
childOpenidList.forEach(model->{
|
||||
JSONObject openidJson = new JSONObject();
|
||||
openidJson.put("openid", model);
|
||||
openidJson.put("lang", "zh_CN");
|
||||
openidJsonArray.add(openidJson);
|
||||
});
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
jsonParam.put("user_list", openidJsonArray);
|
||||
String unionUrl = "https://api.weixin.qq.com/cgi-bin/user/info/batchget?access_token="+WechatMsgUtils.getToken();;
|
||||
logger.info("调用获取用户信息,请求url:{}, 请求body:{}", unionUrl, jsonParam.toJSONString());
|
||||
String getUnionResult = HttpUtil.post(unionUrl, jsonParam.toJSONString());
|
||||
logger.info("获取公众号union列表:{}", getUnionResult);
|
||||
JSONObject unionJson = JSONObject.parseObject(getUnionResult);
|
||||
JSONArray unionJsonArray = unionJson.getJSONArray("user_info_list");
|
||||
for (int index = 0 ; index<unionJsonArray.size(); index ++){
|
||||
JSONObject json = unionJsonArray.getJSONObject(index);
|
||||
if(StringUtils.isNotEmpty(json.getString("unionid") )&& StringUtils.isNotEmpty(unionId)){
|
||||
if(json.getString("unionid").equals(unionId)){
|
||||
Worker updateWorker = new Worker();
|
||||
updateWorker.setWorkerId(worker.getWorkerId());
|
||||
updateWorker.setWxOpenId(json.getString("openid"));
|
||||
logger.info("关联后的worker信息:{}", worker);
|
||||
workerService.updateWorker(updateWorker);
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(flag){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(flag){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(flag);
|
||||
}catch (Exception e){
|
||||
return AjaxResult.success(false);
|
||||
}
|
||||
return AjaxResult.success(flag);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ public class InsuranceOrderEditReq {
|
|||
|
||||
private String workerID;
|
||||
|
||||
private String shangmenTime;
|
||||
|
||||
private String shangmenNum;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,8 +163,6 @@ public class OrderListResponse {
|
|||
*/
|
||||
private Integer timeoutFineTimes;
|
||||
|
||||
private Integer afterTimeout;
|
||||
|
||||
private String orderMode;
|
||||
|
||||
/*是否合约订单*/
|
||||
|
|
|
|||
|
|
@ -80,6 +80,4 @@ public class OrderStandardDetail {
|
|||
*/
|
||||
private Integer timeoutFineTimes;
|
||||
|
||||
private Integer afterTimeout;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import com.ghy.order.domain.OrderDetailInsuranceUser;
|
|||
|
||||
public interface InsuranceService {
|
||||
|
||||
void clockInsurance(Long orderDetailId) throws Exception;
|
||||
|
||||
void orderInsurance(String orderCode) throws Exception;
|
||||
|
||||
void editInsurance(OrderDetailInsuranceUser orderDetailInsuranceUser) throws Exception ;
|
||||
|
|
|
|||
|
|
@ -58,9 +58,6 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|||
public void orderInsurance(String orderCode) throws Exception{
|
||||
InsuranceOrderReq req = new InsuranceOrderReq();
|
||||
OrderMaster master = orderMasterService.selectByCode(orderCode);
|
||||
if(master.getInsuranceId() == null){
|
||||
return;
|
||||
}
|
||||
req.setOrderNumber(master.getCode());
|
||||
req.setRequestNo(master.getCode() + System.currentTimeMillis());
|
||||
req.setSign(Md5Utils.hash(req.getRequestNo() + req.getChannelCode() + Key));
|
||||
|
|
@ -78,7 +75,7 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|||
log.info("调用保险请求url:{},内容:{}", baseUrl+"/platInterface/order", JSONUtil.toJsonStr(req));
|
||||
String result = HttpUtil.post(baseUrl+"/platInterface/order", JSONUtil.toJsonStr(req));
|
||||
log.info("调用保险返回内容:{}", result);
|
||||
if(!"1".equals(JSONObject.parseObject(result).getString("code")) && !JSONObject.parseObject(result).getString("msg").contains("已存在该工单")){
|
||||
if(!"1".equals(JSONObject.parseObject(result).getString("code"))){
|
||||
throw new Exception(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
}
|
||||
|
|
@ -127,27 +124,4 @@ public class InsuranceServiceImpl implements InsuranceService {
|
|||
throw new Exception(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clockInsurance(Long orderDetailId) throws Exception {
|
||||
// 查询子单
|
||||
OrderDetail detail = orderDetailService.selectById(orderDetailId);
|
||||
// 查询主单
|
||||
OrderMaster master = orderMasterService.selectById(detail.getOrderMasterId());
|
||||
if(master.getInsuranceId() != null){
|
||||
InsuranceOrderEditReq editReq = new InsuranceOrderEditReq();
|
||||
editReq.setOrderNumber(master.getCode());
|
||||
editReq.setRequestNo(master.getCode() + System.currentTimeMillis());
|
||||
editReq.setSign(Md5Utils.hash(editReq.getRequestNo() + editReq.getChannelCode() + Key));
|
||||
editReq.setOrderNumber(master.getCode());
|
||||
editReq.setShangmenTime(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
editReq.setShangmenNum("1");
|
||||
log.info("调用保险请求url:{},内容:{}", baseUrl+"/platInterface/service", JSONUtil.toJsonStr(editReq));
|
||||
String result = HttpUtil.post(baseUrl+"/platInterface/service", JSONUtil.toJsonStr(editReq));
|
||||
log.info("调用保险返回内容:{}", result);
|
||||
if(!"1".equals(JSONObject.parseObject(result).getString("code"))){
|
||||
throw new Exception(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,9 +60,6 @@
|
|||
<if test="openId != null and openId != ''">
|
||||
AND open_id = #{openId}
|
||||
</if>
|
||||
<if test="placeStatus != null and placeStatus != ''">
|
||||
AND place_status = #{placeStatus}
|
||||
</if>
|
||||
<if test="customerPlace != null and customerPlace != ''">
|
||||
AND customer_place = #{customerPlace}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -89,14 +89,14 @@
|
|||
<if test="isSure != null">is_sure = #{isSure},</if>
|
||||
<if test="isCert != null">is_cert = #{isCert},</if>
|
||||
<if test="deptRate != null and deptRate != ''">dept_rate = #{deptRate},</if>
|
||||
<if test="deptMoney != null">dept_money = #{deptMoney},</if>
|
||||
<if test="deptMoney != null and deptMoney != ''">dept_money = #{deptMoney},</if>
|
||||
<if test="retainRate != null and retainRate != ''">retain_rate = #{retainRate},</if>
|
||||
<if test="retainMoney != null">retain_money = #{retainMoney},</if>
|
||||
<if test="retainMoney != null and retainMoney != ''">retain_money = #{retainMoney},</if>
|
||||
|
||||
<if test="pcDeptRate != null and pcDeptRate != ''">pc_dept_rate = #{pcDeptRate},</if>
|
||||
<if test="pcDeptMoney != null">pc_dept_money = #{pcDeptMoney},</if>
|
||||
<if test="pcDeptMoney != null and pcDeptMoney != ''">pc_dept_money = #{pcDeptMoney},</if>
|
||||
<if test="pcRetainRate != null and pcRetainRate != ''">pc_retain_rate = #{pcRetainRate},</if>
|
||||
<if test="pcRetainMoney != null">pc_retain_money = #{pcRetainMoney},</if>
|
||||
<if test="pcRetainMoney != null and pcRetainMoney != ''">pc_retain_money = #{pcRetainMoney},</if>
|
||||
|
||||
<if test="categorySort != null">category_sort = #{categorySort},</if>
|
||||
<if test="oneRate != null and oneRate != ''">one_rate = #{oneRate},</if>
|
||||
|
|
|
|||
|
|
@ -172,11 +172,6 @@ public class OrderDetail extends BaseEntity {
|
|||
*/
|
||||
private Integer timeout;
|
||||
|
||||
/**
|
||||
* 售后是否超时 1=是 0=否
|
||||
* */
|
||||
private Integer afterTimeout;
|
||||
|
||||
/**
|
||||
* 超时扣款次数
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -87,8 +87,6 @@ public interface OrderDetailMapper {
|
|||
*/
|
||||
int updateTimeout(@Param("id") Long id, @Param("timeout") int timeout, @Param("timeoutFineTimes") int timeoutFineTimes);
|
||||
|
||||
int updateAfterTimeout(@Param("id") Long id, @Param("timeout") int timeout, @Param("timeoutFineTimes") int timeoutFineTimes);
|
||||
|
||||
/**
|
||||
* 通过主订单ID批量更新子订单
|
||||
* 可更新字段: orderStatus
|
||||
|
|
|
|||
|
|
@ -115,6 +115,4 @@ public interface OrderMasterMapper {
|
|||
|
||||
// 根据开始/结算时间进行查询有效的订单主数据。
|
||||
List<OrderMaster> searchByOrderStartTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
int updateCreateTime(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,8 +175,6 @@ public interface OrderDetailService {
|
|||
*/
|
||||
int updateTimeout(Long id, int timeout, int timeoutFineTimes);
|
||||
|
||||
int updateAfterTimeout(Long id, int timeout, int timeoutFineTimes);
|
||||
|
||||
int deleteByMaster(Long masterId);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -149,8 +149,6 @@ public interface OrderMasterService {
|
|||
*/
|
||||
int updateTimeout(Long id, int timeout);
|
||||
|
||||
int updateCreateTime(Long id);
|
||||
|
||||
/**
|
||||
* 更新子订单超时状态
|
||||
*
|
||||
|
|
|
|||
|
|
@ -78,12 +78,8 @@ public class AfterServiceRecordServiceImpl implements IAfterServiceRecordService
|
|||
*/
|
||||
@Override
|
||||
public List<AfterServiceRecord> selectAfterServiceRecordList(AfterServiceRecord afterServiceRecord) {
|
||||
if(afterServiceRecord == null){
|
||||
afterServiceRecord = new AfterServiceRecord();
|
||||
afterServiceRecord.setNeedImgs(false);
|
||||
}
|
||||
List<AfterServiceRecord> list = afterServiceRecordMapper.selectAfterServiceRecordList(afterServiceRecord);
|
||||
if(afterServiceRecord.getNeedImgs() != null && !afterServiceRecord.getNeedImgs()){
|
||||
if(!afterServiceRecord.getNeedImgs()){
|
||||
return list;
|
||||
}
|
||||
list.forEach(record -> {
|
||||
|
|
@ -146,8 +142,6 @@ public class AfterServiceRecordServiceImpl implements IAfterServiceRecordService
|
|||
Assert.notNull(afterServiceRecord, "售后记录不存在!");
|
||||
OrderDetail orderDetail = orderDetailService.selectById(afterServiceRecord.getOrderDetailId());
|
||||
boolean drawCash = orderDetail.getDrawCashTime() != null;
|
||||
// 更新为售后未超时
|
||||
orderDetailService.updateAfterTimeout(afterServiceRecord.getOrderDetailId(), 0, 0);
|
||||
if (one.equals(param.getCustomerFinalCheck()) && one.equals(afterServiceRecord.getWorkerFeedbackResult())) {
|
||||
// 师傅同意 且 客户同意退款
|
||||
afterServiceRecord.setCustomerFinalCheck(1L);
|
||||
|
|
@ -162,7 +156,6 @@ public class AfterServiceRecordServiceImpl implements IAfterServiceRecordService
|
|||
} else {
|
||||
agreeRefund(afterServiceRecord);
|
||||
}
|
||||
// orderDetailService.updateAfterTimeout(afterServiceRecord.getOrderDetailId(), 0, 0);
|
||||
} else if (one.equals(afterServiceRecord.getWorkerFeedbackResult()) && param.getCustomerFinalCheck() == null) {
|
||||
// 师傅同意 且 客户未处理
|
||||
afterServiceRecordMapper.updateAfterServiceRecord(param);
|
||||
|
|
|
|||
|
|
@ -110,9 +110,6 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
|||
@Resource
|
||||
private IOrderAttachmentRecordService orderAttachmentRecordService;
|
||||
|
||||
@Resource
|
||||
private IOrderCallRecordService orderCallRecordService;
|
||||
|
||||
// Adapay 手续费率 默认0.008
|
||||
@Value("${adapay.fee_rate:0.008}")
|
||||
private String feeRate;
|
||||
|
|
@ -199,26 +196,7 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
|||
|
||||
@Override
|
||||
public List<OrderDetail> selectOrderDetailList(OrderDetail orderDetail) {
|
||||
List<OrderDetail> result = new ArrayList<>();
|
||||
List<OrderDetail> orderDetails = orderDetailMapper.selectOrderDetailList(orderDetail);
|
||||
orderDetails.forEach(model->{
|
||||
if(StringUtils.isNotEmpty(orderDetail.getIsCall())){
|
||||
OrderCallRecord param = new OrderCallRecord();
|
||||
// param.setOrderType("02");
|
||||
param.setOrderId(model.getId());
|
||||
List<OrderCallRecord> list = orderCallRecordService.selectOrderCallRecordList(param);
|
||||
// 用于判断是约 还是 排的问题
|
||||
if("01".equals(orderDetail.getIsCall()) && CollectionUtils.isEmpty(list)){
|
||||
result.add(model);
|
||||
}
|
||||
if("02".equals(orderDetail.getIsCall()) && CollectionUtils.isNotEmpty(list)){
|
||||
result.add(model);
|
||||
}
|
||||
}else {
|
||||
result.add(model);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
return orderDetailMapper.selectOrderDetailList(orderDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -650,7 +628,6 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
|||
} else {
|
||||
// 没有罚金 自己承担手续费
|
||||
divMembers.add(new DivMember(memberId, MoneyUtil.toS(odMoney), true));
|
||||
// 平台金额部分抽出来部分承担手续费
|
||||
}
|
||||
String orderNo = "OD_" + orderDetailId + "_" + System.currentTimeMillis();
|
||||
logger.info("子订单[{}]发起分账: {}", orderDetailId, JSON.toJSONString(divMembers));
|
||||
|
|
@ -1128,11 +1105,6 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
|||
return orderDetailMapper.updateTimeout(id, timeout, timeoutFineTimes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAfterTimeout(Long id, int timeout, int timeoutFineTimes) {
|
||||
return orderDetailMapper.updateAfterTimeout(id, timeout, timeoutFineTimes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByMaster(Long masterId) {
|
||||
return orderDetailMapper.deleteByMaster(masterId);
|
||||
|
|
|
|||
|
|
@ -559,11 +559,6 @@ public class OrderMasterServiceImpl implements OrderMasterService {
|
|||
return orderMasterMapper.updateTimeout(id, timeout, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCreateTime(Long id) {
|
||||
return orderMasterMapper.updateCreateTime(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateTimeout(Long id, int timeout, int timeoutFineTimes) {
|
||||
return orderMasterMapper.updateTimeout(id, timeout, timeoutFineTimes);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="timeout" column="timeout_"/>
|
||||
<result property="afterTimeout" column="after_timeout"/>
|
||||
<result property="timeoutFineTimes" column="timeout_fine_times"/>
|
||||
</resultMap>
|
||||
|
||||
|
|
@ -61,8 +60,7 @@
|
|||
update_time,
|
||||
remark,
|
||||
timeout_,
|
||||
timeout_fine_times,
|
||||
after_timeout
|
||||
timeout_fine_times
|
||||
FROM order_detail
|
||||
</sql>
|
||||
|
||||
|
|
@ -93,8 +91,7 @@
|
|||
od.remark,
|
||||
od.draw_cash_status,
|
||||
od.timeout_,
|
||||
od.timeout_fine_times,
|
||||
od.after_timeout
|
||||
od.timeout_fine_times
|
||||
FROM order_detail od
|
||||
LEFT JOIN order_master om ON om.id = od.order_master_id
|
||||
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
||||
|
|
@ -211,9 +208,9 @@
|
|||
<if test="timeout != null">
|
||||
AND od.timeout_ = #{timeout}
|
||||
</if>
|
||||
<!-- <if test="isCall != null">-->
|
||||
<!-- AND om.is_call = #{isCall}-->
|
||||
<!-- </if>-->
|
||||
<if test="isCall != null">
|
||||
AND om.is_call = #{isCall}
|
||||
</if>
|
||||
</where>
|
||||
order by od.create_time
|
||||
<trim suffixOverrides=",">
|
||||
|
|
@ -376,14 +373,6 @@
|
|||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateAfterTimeout">
|
||||
UPDATE order_detail
|
||||
SET after_timeout = #{timeout},
|
||||
timeout_fine_times = #{timeoutFineTimes},
|
||||
update_time = SYSDATE()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateByOrderMasterId">
|
||||
UPDATE order_detail
|
||||
<set>
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@
|
|||
AND ca.country_id = #{district}
|
||||
</if>
|
||||
<if test="isMonitoredOrder">
|
||||
AND (om.all_self_assigned = 0 or om.all_self_assigned is null) AND om.order_status in (0,1,2,3,4) and om.worker_id is not null
|
||||
AND (om.all_self_assigned = 0 or om.all_self_assigned is null) AND om.order_status in (1,2,3,4)
|
||||
</if>
|
||||
<if test="allSelfAssigned != null">
|
||||
AND all_self_assigned = #{allSelfAssigned}
|
||||
|
|
@ -512,12 +512,6 @@
|
|||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateCreateTime">
|
||||
UPDATE order_master
|
||||
SET create_time = SYSDATE()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="removeWorker">
|
||||
UPDATE order_master
|
||||
SET worker_id = NULL,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package com.ghy.payment.mapper;
|
||||
|
||||
import com.ghy.payment.domain.FinancialDetail;
|
||||
import com.ghy.payment.request.FinancialAccountBillReq;
|
||||
import com.ghy.payment.response.FinancialAccountBillResp;
|
||||
import com.ghy.payment.response.FinancialCountResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -46,8 +44,6 @@ public interface FinancialDetailMapper {
|
|||
*/
|
||||
List<FinancialDetail> selectFinancialDetailList(FinancialDetail financialDetail);
|
||||
|
||||
List<FinancialAccountBillResp> selectFinancialDetailListV2(FinancialAccountBillReq financialAccountBillReq);
|
||||
|
||||
/**
|
||||
* @param financialDetailId 财务细单id
|
||||
* @return 财务细单
|
||||
|
|
|
|||
|
|
@ -1,83 +0,0 @@
|
|||
package com.ghy.payment.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author clunt
|
||||
*/
|
||||
@Data
|
||||
public class FinancialAccountBillReq {
|
||||
|
||||
private Long deptId;
|
||||
|
||||
private String orderCode;
|
||||
|
||||
private Long customerId;
|
||||
|
||||
private Long workerId;
|
||||
|
||||
private String beginTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
// 01.待分账 02.已分账 03.已取消
|
||||
private String billType;
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getOrderCode() {
|
||||
return orderCode;
|
||||
}
|
||||
|
||||
public void setOrderCode(String orderCode) {
|
||||
this.orderCode = orderCode;
|
||||
}
|
||||
|
||||
public Long getCustomerId() {
|
||||
return customerId;
|
||||
}
|
||||
|
||||
public void setCustomerId(Long customerId) {
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public Long getWorkerId() {
|
||||
return workerId;
|
||||
}
|
||||
|
||||
public void setWorkerId(Long workerId) {
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public String getBeginTime() {
|
||||
return beginTime;
|
||||
}
|
||||
|
||||
public void setBeginTime(String beginTime) {
|
||||
this.beginTime = beginTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getBillType() {
|
||||
return billType;
|
||||
}
|
||||
|
||||
public void setBillType(String billType) {
|
||||
this.billType = billType;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package com.ghy.payment.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author clunt
|
||||
*/
|
||||
@Data
|
||||
public class FinancialAccountBillResp {
|
||||
// om.code as order_code,
|
||||
// fd.pay_money as pay_money,
|
||||
// om.create_time as create_time,
|
||||
// om.order_status as order_status,
|
||||
// fm.pay_status as pay_status,
|
||||
// fm.code as pay_code,
|
||||
// fm.pay_time as pay_time
|
||||
private String orderCode;
|
||||
private BigDecimal payMoney;
|
||||
private Date createTime;
|
||||
private Integer orderStatus;
|
||||
private String orderStatusDesc;
|
||||
private Integer payStatus;
|
||||
private String payStatusDesc;
|
||||
private String payCode;
|
||||
private Date payTime;
|
||||
|
||||
}
|
||||
|
|
@ -7,8 +7,6 @@ import java.util.List;
|
|||
@Data
|
||||
public class FinancialCountResponse {
|
||||
|
||||
private String orderCode;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private String payCount;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package com.ghy.payment.service;
|
||||
|
||||
import com.ghy.payment.domain.FinancialDetail;
|
||||
import com.ghy.payment.request.FinancialAccountBillReq;
|
||||
import com.ghy.payment.response.FinancialAccountBillResp;
|
||||
import com.ghy.payment.response.FinancialCountResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -125,7 +123,4 @@ public interface FinancialDetailService {
|
|||
* @param reverseId Adapay撤销支付ID
|
||||
*/
|
||||
void refundSucceeded(String reverseId);
|
||||
|
||||
List<FinancialAccountBillResp> selectFinancialDetailListV2(FinancialAccountBillReq financialAccountBillReq);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ import com.ghy.common.core.text.Convert;
|
|||
import com.ghy.common.enums.FinancialDetailType;
|
||||
import com.ghy.payment.domain.FinancialDetail;
|
||||
import com.ghy.payment.mapper.FinancialDetailMapper;
|
||||
import com.ghy.payment.request.FinancialAccountBillReq;
|
||||
import com.ghy.payment.response.FinancialAccountBillResp;
|
||||
import com.ghy.payment.response.FinancialCountResponse;
|
||||
import com.ghy.payment.service.FinancialDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -95,26 +93,6 @@ public class FinancialDetailServiceImpl implements FinancialDetailService {
|
|||
return financialDetailMapper.selectFinancialDetailList(financialDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FinancialAccountBillResp> selectFinancialDetailListV2(FinancialAccountBillReq financialAccountBillReq) {
|
||||
List<FinancialAccountBillResp> list = financialDetailMapper.selectFinancialDetailListV2(financialAccountBillReq);
|
||||
list.forEach(model->{
|
||||
if(model.getOrderStatus() == 6){
|
||||
model.setOrderStatusDesc("运营利润--已取消");
|
||||
}else if(model.getOrderStatus() == 5){
|
||||
model.setOrderStatusDesc("运营利润--已到账");
|
||||
}else {
|
||||
model.setOrderStatusDesc("运营利润--待分账");
|
||||
}
|
||||
if(model.getPayStatus() == 1){
|
||||
model.setPayStatusDesc("已支付");
|
||||
}else {
|
||||
model.setPayStatusDesc("未支付");
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinancialDetail selectById(Long financialDetailId) {
|
||||
return financialDetailMapper.selectById(financialDetailId);
|
||||
|
|
|
|||
|
|
@ -28,16 +28,6 @@
|
|||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="FinancialAccountBillResult" type="com.ghy.payment.response.FinancialAccountBillResp">
|
||||
<id property="orderCode" column="order_code"/>
|
||||
<id property="payMoney" column="pay_money"/>
|
||||
<id property="createTime" column="create_time"/>
|
||||
<id property="orderStatus" column="order_status"/>
|
||||
<id property="payStatus" column="pay_status"/>
|
||||
<id property="payCode" column="pay_code"/>
|
||||
<id property="payTime" column="pay_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="countResult" type="com.ghy.payment.response.FinancialCountResponse">
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="payCount" column="pay_count"/>
|
||||
|
|
@ -107,51 +97,6 @@
|
|||
order by fd.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectFinancialDetailListV2" parameterType="com.ghy.payment.request.FinancialAccountBillReq"
|
||||
resultMap="FinancialAccountBillResult">
|
||||
select
|
||||
om.code as order_code,
|
||||
fd.pay_money as pay_money,
|
||||
om.create_time as create_time,
|
||||
om.order_status as order_status,
|
||||
fm.pay_status as pay_status,
|
||||
fm.code as pay_code,
|
||||
fd.pay_time as pay_time
|
||||
from financial_detail fd
|
||||
left join financial_master fm on fd.financial_master_id = fm.id
|
||||
left join order_master om on fm.order_master_id = om.id
|
||||
<where>
|
||||
<if test="deptId != null">
|
||||
AND fd.dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="workerId != null">
|
||||
AND fd.payee_id = #{workerId}
|
||||
</if>
|
||||
<if test="customerId != null">
|
||||
AND fd.payee_id = #{customerId}
|
||||
</if>
|
||||
<if test="orderCode != null and orderCode != ''">
|
||||
AND om.code like concat('%', #{orderCode}, '%')
|
||||
</if>
|
||||
<if test="billType == '01'">
|
||||
AND om.order_status in ('0','1','2','3','4')
|
||||
</if>
|
||||
<if test="billType == '02'">
|
||||
AND om.order_status = '05'
|
||||
</if>
|
||||
<if test="billType == '03'">
|
||||
AND om.order_status = '06'
|
||||
</if>
|
||||
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
|
||||
and fd.create_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
|
||||
and fd.create_time <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by om.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectById" parameterType="long" resultMap="FinancialDetailResult">
|
||||
<include refid="selectFinancialDetail"/> WHERE id = #{financialDetailId}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
package com.ghy.quartz.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ghy.common.enums.OrderStatus;
|
||||
import com.ghy.order.domain.AfterServiceRecord;
|
||||
import com.ghy.order.domain.OrderDetail;
|
||||
import com.ghy.order.domain.OrderMaster;
|
||||
import com.ghy.order.service.IAfterServiceRecordService;
|
||||
import com.ghy.order.service.OrderDetailService;
|
||||
import com.ghy.order.service.OrderMasterService;
|
||||
import com.ghy.payment.domain.FinancialDetail;
|
||||
|
|
@ -45,7 +42,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
*
|
||||
* @see OrderStatus
|
||||
*/
|
||||
@Value("${order.timeout.status:-4,-3,-2,-1,0,2,1,3}")
|
||||
@Value("${order.timeout.status:-4,-3,-2,0,2,1,3}")
|
||||
private List<Integer> timeoutOrderStatus;
|
||||
private static final List<Integer> orderMasterTimeoutStatus = Arrays.asList(0, 1);
|
||||
|
||||
|
|
@ -63,8 +60,6 @@ public class OrderServiceImpl implements OrderService {
|
|||
private FinancialMasterService financialMasterService;
|
||||
@Resource
|
||||
private ISysDeptConfigService sysDeptConfigService;
|
||||
@Resource
|
||||
private IAfterServiceRecordService afterServiceRecordService;
|
||||
|
||||
@Override
|
||||
public void overTimeOrder(String orderStatus) {
|
||||
|
|
@ -131,7 +126,6 @@ public class OrderServiceImpl implements OrderService {
|
|||
// 已超时 45min后取消超时状态 清空workerId
|
||||
orderMasterService.updateTimeout(order.getId(), 0);
|
||||
orderMasterService.removeWorker(order.getId());
|
||||
orderMasterService.updateCreateTime(order.getId());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
@ -193,18 +187,6 @@ public class OrderServiceImpl implements OrderService {
|
|||
boolean timeout = ONE.equals(order.getTimeout());
|
||||
// 超时扣款次数
|
||||
Integer times = order.getTimeoutFineTimes();
|
||||
// 判断是否是售后订单
|
||||
AfterServiceRecord afterParam = new AfterServiceRecord();
|
||||
afterParam.setOrderDetailId(order.getId());
|
||||
List<AfterServiceRecord> afterServiceRecord = afterServiceRecordService.selectAfterServiceRecordList(afterParam);
|
||||
if(CollectionUtil.isNotEmpty(afterServiceRecord) && (afterServiceRecord.get(0).getCustomerFinalCheck() == null || afterServiceRecord.get(0).getCustomerFinalCheck() != 1L)){
|
||||
// 查询一下售后单时间
|
||||
Date afterTime = getOverTime(afterServiceRecord.get(0).getUpdateTime(), 30 * 60 * 1000);
|
||||
if (afterTime.before(now)) {
|
||||
log.info("售后订单[{}]超时30分钟", order.getId());
|
||||
orderDetailService.updateAfterTimeout(order.getId(), 1, 0);
|
||||
}
|
||||
}
|
||||
if (!timeout) {
|
||||
log.info("单号:{},状态:{},创建时间:{},更新时间:{}", order.getCode(), order.getOrderStatus(), order.getCreateTime(), order.getUpdateTime());
|
||||
// 待上门超时
|
||||
|
|
@ -223,7 +205,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
// 未超时的单
|
||||
else if (order.getOrderStatus().equals(OrderStatus.SERVER.code())) {
|
||||
// 服务中状态要按预计上门时间计算4h超时
|
||||
Date overTime = DateUtils.addMilliseconds(order.getUpdateTime(), 4 * 60 * 60 * 1000);
|
||||
Date overTime = DateUtils.addMilliseconds(order.getExpectTimeStart(), 4 * 60 * 60 * 1000);
|
||||
if (overTime.before(now)) {
|
||||
log.info("订单[{}]服务中状态超时4小时 扣款", order.getId());
|
||||
OrderTimeoutRecord record = new OrderTimeoutRecord(order.getId(), order.getWorkerId(), order.getDeptId(), order.getOrderStatus());
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
package com.ghy.system.domain;
|
||||
|
||||
import com.ghy.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>轮播图管理</p>
|
||||
* @author clunt
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysBanner extends BaseEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String bannerUrl;
|
||||
|
||||
private String bannerTitle;
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue