OrderDetail.deptId 为null,改用 OrderMaster.deptId

This commit is contained in:
Hawking 2023-05-10 14:11:54 +08:00
parent dd43a90d15
commit 6013517d26
3 changed files with 5 additions and 7 deletions

View File

@ -173,8 +173,9 @@ public class OrderServiceImpl implements OrderService {
* 计算订单罚金(固定罚金+比例罚金) * 计算订单罚金(固定罚金+比例罚金)
*/ */
private BigDecimal getFineMoney(OrderDetail order) { private BigDecimal getFineMoney(OrderDetail order) {
OrderMaster orderMaster = orderMasterService.selectById(order.getOrderMasterId());
FinancialDetail orderFinancial = financialDetailService.selectByOrderDetailId(order.getId()); FinancialDetail orderFinancial = financialDetailService.selectByOrderDetailId(order.getId());
SysDeptConfig deptConfig = sysDeptConfigService.selectByDeptId(order.getDeptId()); SysDeptConfig deptConfig = sysDeptConfigService.selectByDeptId(orderMaster.getDeptId());
BigDecimal fineMoney = deptConfig.getGoingOutTime(); BigDecimal fineMoney = deptConfig.getGoingOutTime();
// 如果扣款额为null或<0 // 如果扣款额为null或<0
if (fineMoney == null || BigDecimal.ZERO.compareTo(fineMoney) > -1) { if (fineMoney == null || BigDecimal.ZERO.compareTo(fineMoney) > -1) {

View File

@ -7,6 +7,7 @@ import com.ghy.system.mapper.SysDeptConfigMapper;
import com.ghy.system.mapper.SysDeptMapper; import com.ghy.system.mapper.SysDeptMapper;
import com.ghy.system.service.ISysDeptConfigService; import com.ghy.system.service.ISysDeptConfigService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -26,6 +27,7 @@ public class SysDeptConfigServiceImpl implements ISysDeptConfigService {
@Override @Override
public SysDeptConfig selectByDeptId(Long deptId) { public SysDeptConfig selectByDeptId(Long deptId) {
Assert.notNull(deptId, "deptId is null!!!");
return sysDeptConfigMapper.selectByDeptId(deptId); return sysDeptConfigMapper.selectByDeptId(deptId);
} }

View File

@ -54,12 +54,7 @@
<select id="selectByDeptId" parameterType="long" resultMap="SysDeptConfigResult"> <select id="selectByDeptId" parameterType="long" resultMap="SysDeptConfigResult">
<include refid="selectSysDeptConfig"/> <include refid="selectSysDeptConfig"/>
<where> WHERE dept_id = #{deptId}
<if test="deptId != null and deptId != 0">
AND dept_id = #{deptId}
</if>
</where>
</select> </select>
<select id="selectAllMerchant" resultMap="SysDeptConfigResult"> <select id="selectAllMerchant" resultMap="SysDeptConfigResult">