Merge branch 'master' of https://gitee.com/op-souls/ghy-all
This commit is contained in:
commit
4bd975d7c4
|
|
@ -7,15 +7,36 @@ import com.ghy.common.core.domain.AjaxResult;
|
||||||
import com.ghy.common.core.page.TableDataInfo;
|
import com.ghy.common.core.page.TableDataInfo;
|
||||||
import com.ghy.common.enums.BusinessType;
|
import com.ghy.common.enums.BusinessType;
|
||||||
import com.ghy.common.utils.poi.ExcelUtil;
|
import com.ghy.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ghy.customer.domain.Customer;
|
||||||
|
import com.ghy.customer.domain.CustomerAddress;
|
||||||
|
import com.ghy.customer.service.CustomerAddressService;
|
||||||
|
import com.ghy.customer.service.CustomerService;
|
||||||
|
import com.ghy.goods.domain.Goods;
|
||||||
|
import com.ghy.goods.domain.GoodsStandard;
|
||||||
|
import com.ghy.goods.service.GoodsService;
|
||||||
|
import com.ghy.goods.service.GoodsStandardService;
|
||||||
import com.ghy.order.domain.OrderDetail;
|
import com.ghy.order.domain.OrderDetail;
|
||||||
|
import com.ghy.order.domain.OrderGoods;
|
||||||
|
import com.ghy.order.domain.OrderMaster;
|
||||||
import com.ghy.order.service.OrderDetailService;
|
import com.ghy.order.service.OrderDetailService;
|
||||||
|
import com.ghy.order.service.OrderGoodsService;
|
||||||
|
import com.ghy.order.service.OrderMasterService;
|
||||||
|
import com.ghy.payment.domain.FinancialDetail;
|
||||||
|
import com.ghy.payment.domain.FinancialMaster;
|
||||||
|
import com.ghy.payment.service.FinancialDetailService;
|
||||||
|
import com.ghy.web.pojo.vo.OrderListResponse;
|
||||||
|
import com.ghy.web.pojo.vo.OrderStandard;
|
||||||
|
import com.ghy.worker.domain.Worker;
|
||||||
|
import com.ghy.worker.service.WorkerService;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,6 +52,22 @@ public class OrderDetailController extends BaseController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private OrderDetailService orderDetailService;
|
private OrderDetailService orderDetailService;
|
||||||
|
@Autowired
|
||||||
|
private OrderMasterService orderMasterService;
|
||||||
|
@Autowired
|
||||||
|
private CustomerService customerService;
|
||||||
|
@Autowired
|
||||||
|
private WorkerService workerService;
|
||||||
|
@Autowired
|
||||||
|
private OrderGoodsService orderGoodsService;
|
||||||
|
@Autowired
|
||||||
|
private CustomerAddressService addressService;
|
||||||
|
@Autowired
|
||||||
|
private GoodsService goodsService;
|
||||||
|
@Autowired
|
||||||
|
private GoodsStandardService goodsStandardService;
|
||||||
|
@Autowired
|
||||||
|
private FinancialDetailService financialDetailService;
|
||||||
|
|
||||||
@RequiresPermissions("order:detail:view")
|
@RequiresPermissions("order:detail:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
|
|
@ -47,6 +84,72 @@ public class OrderDetailController extends BaseController {
|
||||||
return getDataTable(orderDetailList);
|
return getDataTable(orderDetailList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/app/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo appList(OrderDetail orderDetail){
|
||||||
|
|
||||||
|
startPage();
|
||||||
|
List<OrderListResponse> orderListResponses = new ArrayList<>();
|
||||||
|
List<OrderDetail> list = orderDetailService.selectOrderDetailList(orderDetail);
|
||||||
|
list.forEach(detail->{
|
||||||
|
|
||||||
|
// 主单信息
|
||||||
|
OrderMaster orderMaster = orderMasterService.selectById(detail.getOrderMasterId());
|
||||||
|
// 初始化属性
|
||||||
|
OrderListResponse orderListResponse = new OrderListResponse();
|
||||||
|
List<OrderStandard> standardList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 师傅信息
|
||||||
|
Worker worker = workerService.selectById(detail.getWorkerId());
|
||||||
|
|
||||||
|
// 消费者信息
|
||||||
|
Customer customer = customerService.selectByCustomerId(detail.getCustomerId());
|
||||||
|
|
||||||
|
// 商品规格及信息
|
||||||
|
List<OrderGoods> orderStandardList = orderGoodsService.selectByOrderMasterId(detail.getId());
|
||||||
|
|
||||||
|
// 商品信息
|
||||||
|
GoodsStandard goodsStandard = goodsStandardService.selectById(orderStandardList.get(0).getGoodsStandardId());
|
||||||
|
|
||||||
|
Goods goods = goodsService.selectById(goodsStandard.getGoodsId());
|
||||||
|
|
||||||
|
// 财务信息
|
||||||
|
FinancialDetail financialDetail = financialDetailService.selectByOrderDetailId(detail.getId());
|
||||||
|
|
||||||
|
// 地址信息
|
||||||
|
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(orderMaster.getAddressId());
|
||||||
|
|
||||||
|
for(OrderGoods orderGoods : orderStandardList){
|
||||||
|
OrderStandard orderStandard = new OrderStandard();
|
||||||
|
orderStandard.setStandardName(orderGoods.getGoodsName());
|
||||||
|
orderStandard.setStandardNum(orderGoods.getGoodsNum());
|
||||||
|
standardList.add(orderStandard);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑返回属性
|
||||||
|
orderListResponse.setOrderMasterId(detail.getId());
|
||||||
|
orderListResponse.setGoodsName(goods.getGoodsName());
|
||||||
|
orderListResponse.setGoodsLogoUrl(goods.getGoodsImgUrl());
|
||||||
|
orderListResponse.setDiscountMoney(financialDetail.getDiscountMoney());
|
||||||
|
orderListResponse.setTotalMoney(financialDetail.getTotalMoney());
|
||||||
|
orderListResponse.setPayMoney(financialDetail.getPayMoney());
|
||||||
|
orderListResponse.setWorkerName(worker.getName());
|
||||||
|
orderListResponse.setWorkerPhone(worker.getPhone());
|
||||||
|
orderListResponse.setCustomerName(customer.getName());
|
||||||
|
orderListResponse.setCustomerPhone(customer.getPhone());
|
||||||
|
orderListResponse.setServerTime(detail.getWorkBeginTime());
|
||||||
|
orderListResponse.setOrderStatus(detail.getOrderStatus());
|
||||||
|
orderListResponse.setPayStatus(orderMaster.getPayStatus());
|
||||||
|
orderListResponse.setPayType(orderMaster.getPayType());
|
||||||
|
orderListResponse.setOrderMasterCode(detail.getCode());
|
||||||
|
orderListResponse.setStandardList(standardList);
|
||||||
|
orderListResponse.setAddress(customerAddress.getAddress());
|
||||||
|
orderListResponses.add(orderListResponse);
|
||||||
|
|
||||||
|
});
|
||||||
|
return voDataTable(orderListResponses, list);
|
||||||
|
}
|
||||||
|
|
||||||
@Log(title = "详细订单管理", businessType = BusinessType.EXPORT)
|
@Log(title = "详细订单管理", businessType = BusinessType.EXPORT)
|
||||||
@RequiresPermissions("order:detail:export")
|
@RequiresPermissions("order:detail:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,12 @@ public interface FinancialDetailMapper {
|
||||||
*/
|
*/
|
||||||
List<FinancialCountResponse> count(FinancialCountResponse response);
|
List<FinancialCountResponse> count(FinancialCountResponse response);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param orderDetailId 细单id
|
||||||
|
* @return 细单关联财务单
|
||||||
|
*/
|
||||||
|
FinancialDetail selectByOrderDetailId(@Param("orderDetailId") Long orderDetailId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param financialDetail 财务细单属性
|
* @param financialDetail 财务细单属性
|
||||||
* @return 成功条数
|
* @return 成功条数
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,16 @@ public interface FinancialDetailService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param countTime 是否查询准确时间
|
* @param countTime 是否查询准确时间
|
||||||
* @param flag 0收入 1支出
|
|
||||||
* @return 月份集合
|
* @return 月份集合
|
||||||
*/
|
*/
|
||||||
List<FinancialCountResponse> count(String countTime);
|
List<FinancialCountResponse> count(String countTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param orderDetailId 细单id
|
||||||
|
* @return 细单关联财务单
|
||||||
|
*/
|
||||||
|
FinancialDetail selectByOrderDetailId(Long orderDetailId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param financialDetail 财务细单属性
|
* @param financialDetail 财务细单属性
|
||||||
* @return 成功条数
|
* @return 成功条数
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,11 @@ public class FinancialDetailServiceImpl implements FinancialDetailService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FinancialDetail selectByOrderDetailId(Long orderDetailId) {
|
||||||
|
return financialDetailMapper.selectByOrderDetailId(orderDetailId);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertFinancialDetail(FinancialDetail financialDetail) {
|
public int insertFinancialDetail(FinancialDetail financialDetail) {
|
||||||
return financialDetailMapper.insertFinancialDetail(financialDetail);
|
return financialDetailMapper.insertFinancialDetail(financialDetail);
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,12 @@
|
||||||
WHERE reverse_id = #{reverseId}
|
WHERE reverse_id = #{reverseId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectByOrderDetailId" resultMap="FinancialDetailResult">
|
||||||
|
<include refid="selectFinancialDetail" />
|
||||||
|
WHERE
|
||||||
|
order_detail_id = #{orderDetailId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="count" resultMap="countResult">
|
<select id="count" resultMap="countResult">
|
||||||
select DATE_FORMAT(create_time,'%Y-%m') as create_time,
|
select DATE_FORMAT(create_time,'%Y-%m') as create_time,
|
||||||
sum(pay_money) as income_count from financial_detail
|
sum(pay_money) as income_count from financial_detail
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue