11.19
This commit is contained in:
parent
3914945210
commit
6c1be3c72f
@ -29,6 +29,17 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getFuelAmountByUserId" resultType="com.fuint.business.userManager.entity.MtUserFuel">
|
||||
select * from
|
||||
mt_user_fuel
|
||||
<where>
|
||||
<if test="userId != null and userId != ''">
|
||||
and mt_user_id = #{userId}
|
||||
</if>
|
||||
<if test="oilType != null and oilType != ''">
|
||||
and oil_name = #{oilType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -33,8 +33,10 @@ import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableR
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.vo.CardFavorableVO;
|
||||
import com.fuint.business.marketingActivity.cardFule.dto.CardFuelRecordDTO;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelChange;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
|
||||
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelRecord;
|
||||
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelChangeMapper;
|
||||
import com.fuint.business.marketingActivity.cardFule.mapper.CardFuelRecordMapper;
|
||||
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
|
||||
import com.fuint.business.marketingActivity.cardFule.service.CardFuelRecordService;
|
||||
@ -62,6 +64,7 @@ import com.fuint.business.order.service.GrowthValueChangeService;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilGun;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilName;
|
||||
import com.fuint.business.petrolStationManagement.entity.OilTank;
|
||||
import com.fuint.business.petrolStationManagement.service.OilNameService;
|
||||
import com.fuint.business.store.entity.MtStore;
|
||||
import com.fuint.business.store.mapper.MtStoreMapper;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
@ -1452,6 +1455,11 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
CardFuelRecordMapper cardFuelRecordMapper;
|
||||
@Resource
|
||||
AllOrderInfoMapper allOrderInfoMapper;
|
||||
@Resource
|
||||
OilNameService oilNameService;
|
||||
|
||||
@Resource
|
||||
CardFuelChangeMapper cardFuelChangeMapper;
|
||||
|
||||
/**
|
||||
* 囤油卡查询支付状态 修改相关关联表
|
||||
@ -1513,6 +1521,27 @@ public class CardValueRecordServiceImpl extends ServiceImpl<CardValueRecordMappe
|
||||
growthValueChange.setAfterTheChange(cardFuelRecord.getGrowthValue());
|
||||
growthValueChangeService.insertGrowthValueChange(growthValueChange);
|
||||
}
|
||||
OilName oilName= oilNameService.getById(cardFuelRecord.getOilType());
|
||||
MtUserFuel mtUserFuel=mtUserFuelMapper.getFuelAmountByUserId(cardFuelRecord.getMtUserId().toString(),cardFuelRecord.getOilType());
|
||||
CardFuelChange cardFuelChange = new CardFuelChange();
|
||||
cardFuelChange.setUserId(allOrderInfo.getUserId());
|
||||
cardFuelChange.setChainStoreId(cardFuelRecord.getChainStoreId());
|
||||
cardFuelChange.setStoreId(cardFuelRecord.getStoreId());
|
||||
cardFuelChange.setChangeType("1");
|
||||
cardFuelChange.setFromType("囤油卡充值");
|
||||
cardFuelChange.setBalance(cardFuelRecord.getIncomeLitres());
|
||||
cardFuelChange.setCreateTime(cardFuelRecord.getCreateTime());
|
||||
cardFuelChange.setCreateBy(cardFuelRecord.getCreateBy());
|
||||
cardFuelChange.setType(oilName.getOilType()+" "+oilName.getOilName());
|
||||
cardFuelChange.setOilType(cardFuelRecord.getOilType());
|
||||
if(ObjectUtil.isNotEmpty(mtUserFuel)){
|
||||
cardFuelChange.setAfterTheChange(mtUserFuel.getFuelAmount());
|
||||
}else {
|
||||
cardFuelChange.setAfterTheChange(cardFuelRecord.getIncomeLitres());
|
||||
}
|
||||
cardFuelChange.setOrderNo(cardFuelRecord.getPaymentNo());
|
||||
cardFuelChangeMapper.insert(cardFuelChange);
|
||||
|
||||
// 员工提成
|
||||
// if (ObjectUtil.isNotEmpty(cardValueRecord.getMtStaffId()) && !ObjectUtil.isEmpty(cardValueRecord.getRoyaltyType()) && !"1".equals(cardValueRecord.getRoyaltyType())) {
|
||||
// if (ObjectUtil.isNotEmpty(cardValueRecord.getMtStaffId())) {
|
||||
|
@ -26,4 +26,6 @@ public interface MtUserFuelMapper extends BaseMapper<MtUserFuel> {
|
||||
BigDecimal selectSumFuelAmountByStoreIds(@Param("storeIds") List<Long> storeIds);
|
||||
|
||||
List<MtUserFuel> selectUserFuelAndOilName(@Param("obj")LJUserVo userVo);
|
||||
|
||||
MtUserFuel getFuelAmountByUserId(@Param("userId")String userId,@Param("oilType")String oilType);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user