| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "1=中文,2=英文,3=法语", name = "language", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<IntegralOrderWarpper>> queryConvertHistory(Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil<List<IntegralOrderWarpper>> queryConvertHistory(Integer pageNum, Integer size,Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String, Object>> list = integralOrderService.queryConvertHistory(pageNum, size, uid); |
| | | List<Map<String, Object>> list = integralOrderService.queryConvertHistory(pageNum, size, uid,language); |
| | | return ResultUtil.success(IntegralOrderWarpper.getIntegralOrderWarppers(list)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //处理优惠券 |
| | | if(null != userCouponRecord){ |
| | | userCouponRecord.setState(2); |
| | | userCouponRecord.setEndTime(new Date()); |
| | | userCouponRecordService.updateById(userCouponRecord); |
| | | } |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "包裹下单支付", orderMoney, 2, 1, 1, 4, orderId); |
| | | userInfoService.updateById(userInfo); |
| | |
| | | if(payType == 4){//现金支付 |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //处理优惠券和红包 |
| | | if(null != userCouponRecord){ |
| | | userCouponRecord.setState(2); |
| | | userCouponRecord.setEndTime(new Date()); |
| | | userCouponRecordService.updateById(userCouponRecord); |
| | | } |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "包裹下单支付", orderMoney, 2, 1, 1, 4, orderId); |
| | |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | //处理优惠券和红包 |
| | | if(null != orderLogistics.getCouponId()){ |
| | | UserCouponRecord userCouponRecord = userCouponRecordService.selectById(orderLogistics.getCouponId()); |
| | | userCouponRecord.setState(2); |
| | | userCouponRecord.setEndTime(new Date()); |
| | | userCouponRecordService.updateById(userCouponRecord); |
| | | } |
| | | |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | |
| | | a.id as id, |
| | | b.`name` as `name`, |
| | | DATE_FORMAT(a.insertTime, '%Y-%m-%d %H:%i') as time, |
| | | CONCAT(a.integral * -1, '积分') as integral |
| | | CONCAT(a.integral * -1, '') as integral |
| | | from t_integral_order a |
| | | left join t_integral_goods b on (a.goodsId = b.id) |
| | | where a.state != 3 and a.userId = #{uid} |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Map<String, Object>> queryConvertHistory(Integer pageNum, Integer size, Integer uid) throws Exception; |
| | | List<Map<String, Object>> queryConvertHistory(Integer pageNum, Integer size, Integer uid,Integer language) throws Exception; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.service.IIntegralOrderService; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryConvertHistory(Integer pageNum, Integer size, Integer uid) throws Exception { |
| | | public List<Map<String, Object>> queryConvertHistory(Integer pageNum, Integer size, Integer uid,Integer language) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | return integralOrderMapper.queryConvertHistory(pageNum, size, uid); |
| | | List<Map<String, Object>> list = integralOrderMapper.queryConvertHistory(pageNum, size, uid); |
| | | for (Map<String, Object> map : list) { |
| | | if(null != map.get("integral") && !"".equals(map.get("integral"))){ |
| | | String integral = String.valueOf(map.get("integral")); |
| | | if(language == 1){ |
| | | integral = integral + "积分"; |
| | | }else{ |
| | | // 积分的英语与法语翻译一致 |
| | | integral = integral + " points"; |
| | | } |
| | | map.put("integral",integral); |
| | | } |
| | | |
| | | if(null != map.get("time")){ |
| | | String time = map.get("time").toString(); |
| | | map.put("time", DateUtil.conversionFormat1(language, time)); |
| | | } |
| | | |
| | | } |
| | | return list; |
| | | } |
| | | } |