小程序端订单+小程序端财务单

This commit is contained in:
kuang.yifei@iwhalecloud.com 2022-06-01 23:45:50 +08:00
parent ee2d5ea391
commit 399a1af0a8
10 changed files with 83 additions and 13 deletions

View File

@ -20,6 +20,7 @@ import com.ghy.order.service.OrderGoodsService;
import com.ghy.order.service.OrderMasterService; import com.ghy.order.service.OrderMasterService;
import com.ghy.payment.domain.FinancialDetail; import com.ghy.payment.domain.FinancialDetail;
import com.ghy.payment.service.FinancialDetailService; import com.ghy.payment.service.FinancialDetailService;
import com.ghy.payment.service.FinancialMasterService;
import com.ghy.web.pojo.vo.OrderDetailsResponseVo; import com.ghy.web.pojo.vo.OrderDetailsResponseVo;
import com.ghy.worker.domain.Worker; import com.ghy.worker.domain.Worker;
import com.ghy.worker.service.WorkerService; import com.ghy.worker.service.WorkerService;
@ -49,13 +50,22 @@ public class OrderMasterController extends BaseController {
private final String prefix = "order/master"; private final String prefix = "order/master";
private final OrderMasterService orderMasterService; @Autowired
private final CustomerService customerService; private OrderMasterService orderMasterService;
private final WorkerService workerService; @Autowired
private final OrderDetailService orderDetailService; private CustomerService customerService;
private final OrderGoodsService orderGoodsService; @Autowired
private final CustomerAddressService customerAddressService; private WorkerService workerService;
private final FinancialDetailService financialDetailService; @Autowired
private OrderDetailService orderDetailService;
@Autowired
private OrderGoodsService orderGoodsService;
@Autowired
private CustomerAddressService customerAddressService;
@Autowired
private FinancialDetailService financialDetailService;
@Autowired
private FinancialMasterService financialMasterService;
@RequiresPermissions("order:master:view") @RequiresPermissions("order:master:view")
@GetMapping() @GetMapping()
@ -63,6 +73,24 @@ public class OrderMasterController extends BaseController {
return prefix; return prefix;
} }
@PostMapping("/app/list")
@ResponseBody
public TableDataInfo appList(OrderMaster orderMaster){
startPage();
List<OrderMaster> list = orderMasterService.selectOrderMasterList(orderMaster);
list.forEach(master->{
// 添加师傅信息
master.setWorker(workerService.selectById(master.getWorkerId()));
// 添加订单商品信息
master.setOrderGoods(orderGoodsService.selectByOrderMasterId(master.getId()));
// 添加财务主单信息
master.setFinancialMaster(financialMasterService.selectByOrderMasterId(master.getId()));
});
return getDataTable(list);
}
@RequiresPermissions("order:master:list") @RequiresPermissions("order:master:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody

View File

@ -51,10 +51,10 @@ public class FinancialDetailController extends BaseController {
} }
} }
@RequiresPermissions("financial:detail:list") // @RequiresPermissions("financial:detail:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(FinancialDetail financialDetail) { public TableDataInfo list(@RequestBody FinancialDetail financialDetail) {
startPage(); startPage();
List<FinancialDetail> list = financialDetailService.selectFinancialDetailList(financialDetail); List<FinancialDetail> list = financialDetailService.selectFinancialDetailList(financialDetail);
return getDataTable(list); return getDataTable(list);

View File

@ -28,6 +28,16 @@
<artifactId>ghy-goods</artifactId> <artifactId>ghy-goods</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.ghy</groupId>
<artifactId>ghy-worker</artifactId>
</dependency>
<dependency>
<groupId>com.ghy</groupId>
<artifactId>ghy-payment</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -2,6 +2,8 @@ package com.ghy.order.domain;
import com.ghy.common.annotation.Excel; import com.ghy.common.annotation.Excel;
import com.ghy.common.core.domain.BaseEntity; import com.ghy.common.core.domain.BaseEntity;
import com.ghy.payment.domain.FinancialMaster;
import com.ghy.worker.domain.Worker;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -48,4 +50,10 @@ public class OrderMaster extends BaseEntity {
@Excel(name = "接单时间", cellType = Excel.ColumnType.STRING) @Excel(name = "接单时间", cellType = Excel.ColumnType.STRING)
private Date revTime; private Date revTime;
private Worker worker;
private FinancialMaster financialMaster;
private OrderGoods orderGoods;
} }

View File

@ -33,6 +33,8 @@ public interface OrderGoodsMapper {
*/ */
OrderGoods selectById(Long orderGoodsId); OrderGoods selectById(Long orderGoodsId);
OrderGoods selectByOrderId(Long orderId);
/** /**
* 批量删除订单商品信息 * 批量删除订单商品信息
* *

View File

@ -18,6 +18,8 @@ public interface OrderGoodsService {
*/ */
int insertOrderGoods(OrderGoods orderGoods); int insertOrderGoods(OrderGoods orderGoods);
OrderGoods selectByOrderMasterId(Long orderMasterId);
/** /**
* @param orderGoods 订单商品属性 * @param orderGoods 订单商品属性
*/ */

View File

@ -26,6 +26,11 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
return orderGoodsMapper.insertOrderGoods(orderGoods); return orderGoodsMapper.insertOrderGoods(orderGoods);
} }
@Override
public OrderGoods selectByOrderMasterId(Long orderMasterId) {
return orderGoodsMapper.selectByOrderId(orderMasterId);
}
@Override @Override
public int updateOrderGoods(OrderGoods orderGoods) { public int updateOrderGoods(OrderGoods orderGoods) {
Assert.notNull(orderGoods.getOrderGoodsId(), "OrderGoodsId cannot be null!"); Assert.notNull(orderGoods.getOrderGoodsId(), "OrderGoodsId cannot be null!");

View File

@ -87,6 +87,15 @@
</where> </where>
</select> </select>
<select id="selectByOrderId" parameterType="long" resultMap="OrderGoodsResult">
<include refid="selectOrderGoods"/>
<where>
<if test="orderId != null and orderId != 0">
AND order_id = #{orderId}
</if>
</where>
</select>
<delete id="deleteOrderGoodsByIds" parameterType="Long"> <delete id="deleteOrderGoodsByIds" parameterType="Long">
DELETE FROM order_goods WHERE order_goods_id IN DELETE FROM order_goods WHERE order_goods_id IN
<foreach collection="array" item="orderGoodsId" open="(" separator="," close=")"> <foreach collection="array" item="orderGoodsId" open="(" separator="," close=")">

View File

@ -73,6 +73,12 @@ public class FinancialDetail extends BaseEntity {
@Excel(name = "付款时间", cellType = Excel.ColumnType.STRING) @Excel(name = "付款时间", cellType = Excel.ColumnType.STRING)
private Date payTime; private Date payTime;
private String beginTime;
private String endTime;
public FinancialDetail() { public FinancialDetail() {
} }

View File

@ -66,11 +66,11 @@
<if test="financialDetailType != null"> <if test="financialDetailType != null">
AND financial_detail_type = #{financialDetailType} AND financial_detail_type = #{financialDetailType}
</if> </if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
and date_format(r.create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d') and date_format(create_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
</if> </if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d') and date_format(create_time,'%y%m%d') &lt; date_format(#{endTime},'%y%m%d')
</if> </if>
</where> </where>
</select> </select>