服务金额
This commit is contained in:
parent
d6fe137828
commit
b60e7085ea
|
|
@ -193,6 +193,7 @@ public class OrderController extends BaseController {
|
||||||
om.setAllSelfAssigned(0);
|
om.setAllSelfAssigned(0);
|
||||||
// 校验接单师傅和派单师傅是不是同一个Team
|
// 校验接单师傅和派单师傅是不是同一个Team
|
||||||
if(!om.getWorkerId().equals(request.getWorkerId())){
|
if(!om.getWorkerId().equals(request.getWorkerId())){
|
||||||
|
fm.setServerMoney(fm.getServerMoney().subtract(request.getTotalPay()));
|
||||||
boolean checkInTeam = workerService.checkInTeam(assignWorker.getWorkerId(), acceptWorker.getWorkerId());
|
boolean checkInTeam = workerService.checkInTeam(assignWorker.getWorkerId(), acceptWorker.getWorkerId());
|
||||||
Assert.isTrue(checkInTeam, "接单师傅不在本团队");
|
Assert.isTrue(checkInTeam, "接单师傅不在本团队");
|
||||||
}else {
|
}else {
|
||||||
|
|
@ -279,8 +280,8 @@ public class OrderController extends BaseController {
|
||||||
fm.getPayType(), fm.getPayStatus(), fm.getPayTime());
|
fm.getPayType(), fm.getPayStatus(), fm.getPayTime());
|
||||||
financialDetailService.insertFinancialDetail(fd);
|
financialDetailService.insertFinancialDetail(fd);
|
||||||
|
|
||||||
// TODO 检查是否商品全部消耗完成,如果完成则还要给派单师傅生成一条财务细单,并更新orderMaster的状态。
|
// 更新财务主单金额
|
||||||
|
financialMasterService.updateFinancialMaster(fm);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -341,6 +342,7 @@ public class OrderController extends BaseController {
|
||||||
// 生成财务主单
|
// 生成财务主单
|
||||||
FinancialMaster financialMaster = new FinancialMaster(financialMasterService.createCode(), deptId,
|
FinancialMaster financialMaster = new FinancialMaster(financialMasterService.createCode(), deptId,
|
||||||
orderMaster.getId(), orderMaster.getCode(), totalPay, discountMoney, payMoney);
|
orderMaster.getId(), orderMaster.getCode(), totalPay, discountMoney, payMoney);
|
||||||
|
financialMaster.setServerMoney(financialMaster.getTotalMoney());
|
||||||
financialMasterService.insertFinancialMaster(financialMaster);
|
financialMasterService.insertFinancialMaster(financialMaster);
|
||||||
Assert.notNull(financialMaster.getId(), "FinancialMaster.id is null!");
|
Assert.notNull(financialMaster.getId(), "FinancialMaster.id is null!");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,9 @@ public class FinancialMaster extends BaseEntity {
|
||||||
@Excel(name = "实付金额", cellType = Excel.ColumnType.STRING)
|
@Excel(name = "实付金额", cellType = Excel.ColumnType.STRING)
|
||||||
private BigDecimal payMoney;
|
private BigDecimal payMoney;
|
||||||
|
|
||||||
|
@Excel(name = "服务金额", cellType = Excel.ColumnType.STRING)
|
||||||
|
private BigDecimal serverMoney;
|
||||||
|
|
||||||
@Excel(name = "支付方式,微信/支付宝/线下", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "支付方式,微信/支付宝/线下", cellType = Excel.ColumnType.NUMERIC)
|
||||||
private Integer payType;
|
private Integer payType;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
<result property="totalMoney" column="total_money"/>
|
<result property="totalMoney" column="total_money"/>
|
||||||
<result property="discountMoney" column="discount_money"/>
|
<result property="discountMoney" column="discount_money"/>
|
||||||
<result property="payMoney" column="pay_money"/>
|
<result property="payMoney" column="pay_money"/>
|
||||||
|
<result property="serverMoney" column="server_money"/>
|
||||||
<result property="payType" column="pay_type"/>
|
<result property="payType" column="pay_type"/>
|
||||||
<result property="payStatus" column="pay_status"/>
|
<result property="payStatus" column="pay_status"/>
|
||||||
<result property="payTime" column="pay_time"/>
|
<result property="payTime" column="pay_time"/>
|
||||||
|
|
@ -25,7 +26,7 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectFinancialMaster">
|
<sql id="selectFinancialMaster">
|
||||||
SELECT id, dept_id, code, order_master_id, order_master_code, total_money, discount_money, pay_money,
|
SELECT id, dept_id, code, order_master_id, order_master_code, total_money, discount_money, pay_money, server_money,
|
||||||
pay_type, pay_status, pay_time, payment_id, create_by, create_time, update_by, update_time, remark
|
pay_type, pay_status, pay_time, payment_id, create_by, create_time, update_by, update_time, remark
|
||||||
FROM financial_master
|
FROM financial_master
|
||||||
</sql>
|
</sql>
|
||||||
|
|
@ -81,6 +82,7 @@
|
||||||
<if test="orderMasterId != null and orderMasterId != 0">order_master_id = #{orderMasterId},</if>
|
<if test="orderMasterId != null and orderMasterId != 0">order_master_id = #{orderMasterId},</if>
|
||||||
<if test="orderMasterCode != null and orderMasterCode != ''">order_master_code = #{orderMasterCode},</if>
|
<if test="orderMasterCode != null and orderMasterCode != ''">order_master_code = #{orderMasterCode},</if>
|
||||||
<if test="totalMoney != null">total_money = #{totalMoney},</if>
|
<if test="totalMoney != null">total_money = #{totalMoney},</if>
|
||||||
|
<if test="serverMoney != null">server_money = #{serverMoney},</if>
|
||||||
<if test="discountMoney != null">discount_money = #{discountMoney},</if>
|
<if test="discountMoney != null">discount_money = #{discountMoney},</if>
|
||||||
<if test="payType != null">pay_type = #{payType},</if>
|
<if test="payType != null">pay_type = #{payType},</if>
|
||||||
<if test="payStatus != null">pay_status = #{payStatus},</if>
|
<if test="payStatus != null">pay_status = #{payStatus},</if>
|
||||||
|
|
@ -122,6 +124,7 @@
|
||||||
<if test="orderMasterId != null and orderMasterId != 0">order_master_id,</if>
|
<if test="orderMasterId != null and orderMasterId != 0">order_master_id,</if>
|
||||||
<if test="orderMasterCode != null and orderMasterCode != ''">order_master_code,</if>
|
<if test="orderMasterCode != null and orderMasterCode != ''">order_master_code,</if>
|
||||||
<if test="totalMoney != null">total_money,</if>
|
<if test="totalMoney != null">total_money,</if>
|
||||||
|
<if test="serverMoney != null">server_money,</if>
|
||||||
<if test="discountMoney != null">discount_money,</if>
|
<if test="discountMoney != null">discount_money,</if>
|
||||||
<if test="payMoney != null">pay_money,</if>
|
<if test="payMoney != null">pay_money,</if>
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
|
@ -132,6 +135,7 @@
|
||||||
<if test="orderMasterId != null and orderMasterId != 0">#{orderMasterId},</if>
|
<if test="orderMasterId != null and orderMasterId != 0">#{orderMasterId},</if>
|
||||||
<if test="orderMasterCode != null and orderMasterCode != ''">#{orderMasterCode},</if>
|
<if test="orderMasterCode != null and orderMasterCode != ''">#{orderMasterCode},</if>
|
||||||
<if test="totalMoney != null">#{totalMoney},</if>
|
<if test="totalMoney != null">#{totalMoney},</if>
|
||||||
|
<if test="serverMoney != null">#{serverMoney},</if>
|
||||||
<if test="discountMoney != null">#{discountMoney},</if>
|
<if test="discountMoney != null">#{discountMoney},</if>
|
||||||
<if test="payMoney != null">#{payMoney},</if>
|
<if test="payMoney != null">#{payMoney},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue