Merge branch 'dev' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel
Conflicts:
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/AreaMapper.xml
58个文件已删除
20个文件已添加
33个文件已修改
| | |
| | | /DriverIGOTravel/.idea/ |
| | | |
| | | |
| | | .gradle |
| | | /build/ |
| | | !gradle/wrapper/gradle-wrapper.jar |
| | | |
| | | target/ |
| | | !.mvn/wrapper/maven-wrapper.jar |
| | | |
| | | ### STS ### |
| | | .apt_generated |
| | | .classpath |
| | | .factorypath |
| | | .project |
| | | .settings |
| | | .springBeans |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | | |
| | | ### JRebel ### |
| | | rebel.xml |
| | | ### NetBeans ### |
| | | nbproject/private/ |
| | | build/* |
| | | nbbuild/ |
| | | dist/ |
| | | nbdist/ |
| | | .nb-gradle/ |
| | | |
| | | ###################################################################### |
| | | # Others |
| | | *.log |
| | | *.xml.versionsBackup |
| | | *.swp |
| | | *.yml |
| | | |
| | | !*/build/*.java |
| | | !*/build/*.html |
| | | !*/build/*.xml |
| | |
| | | @PostMapping("/api/car/addCar") |
| | | @ApiOperation(value = "添加车辆【1.0】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "车辆型号id", name = "modelId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆型号id", name = "modelId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆id", name = "id", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "车辆颜色", name = "color", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "车牌号", name = "licensePlate", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "年审日期(需要格式化)", name = "time", required = false, dataType = "string"), |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Income> objectId = incomeService.selectList(new EntityWrapper<Income>().eq("objectId", uid)); |
| | | List<Income> objectId = incomeService.selectList(new EntityWrapper<Income>().eq("objectId", uid).eq("type",1)); |
| | | double sum = 0; |
| | | for (Income income : objectId) { |
| | | Double money = income.getMoney(); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.impl.OrderLogisticsSpreadService; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.model.Reassign; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private OrderLogisticsSpreadService spreadService; |
| | | /** |
| | | * 获取服务中页面订单详情 |
| | | * @param orderId |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderInfo") |
| | | @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "",response = OrderInfoWarpper.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,4=小件物流-同城)", name = "orderType", required = true, dataType = "int"), |
| | |
| | | }else{ |
| | | orderInfoWarpper.setOrderPositionList(""); |
| | | } |
| | | |
| | | List<OrderLogisticsSpread> orderLogisticsId = spreadService.selectList(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderId)); |
| | | if (!orderLogisticsId.isEmpty()){ |
| | | double sum = 0; |
| | | for (OrderLogisticsSpread orderLogisticsSpread : orderLogisticsId) { |
| | | |
| | | if (orderLogisticsSpread.getPayType()!=null&&orderLogisticsSpread.getPayType() == 4) { |
| | | Double payMoney = orderLogisticsSpread.getPayMoney(); |
| | | sum = sum + payMoney; |
| | | } |
| | | } |
| | | sum = sum+orderInfoWarpper.getPayMoney(); |
| | | orderInfoWarpper.setPayMoney(sum); |
| | | } |
| | | |
| | | |
| | | return ResultUtil.success(orderInfoWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and state in (2, 3, 4, 5, 8, 11) |
| | | and state in (2, 3, 4, 5, 8, 11,12) |
| | | </select> |
| | | |
| | | |
| | |
| | | package com.stylefeng.guns.modular.smallLogistics.server.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | |
| | | return map; |
| | | } |
| | | |
| | | @Autowired |
| | | private ISettlementDetailService settlementDetailService; |
| | | @Autowired |
| | | private ISettlementAllocationService settlementAllocationService; |
| | | |
| | | @Autowired |
| | | private ISettlementRecordService settlementRecordService; |
| | | |
| | | @Autowired |
| | | private OrderLogisticsSpreadService spreadService; |
| | | /** |
| | | * 走订单流程 |
| | | * @param orderId |
| | |
| | | return ResultUtil.error(language == 1 ? "验证失败" : language == 2 ? "Verification failed" : "Echec de la validation"); |
| | | } |
| | | } |
| | | |
| | | List<OrderLogisticsSpread> orderLogisticsId = spreadService.selectList(new EntityWrapper<OrderLogisticsSpread>().eq("orderLogisticsId", orderLogistics.getId()).eq("payType",4)); |
| | | |
| | | |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | if (orderLogistics.getPayType()==4||!orderLogisticsId.isEmpty()){ |
| | | |
| | | System.err.println("1111111111111111111111111"); |
| | | |
| | | double sum = 0; |
| | | if (orderLogistics.getPayType()==4){ |
| | | sum= orderLogistics.getOrderMoney(); |
| | | } |
| | | |
| | | if (!orderLogisticsId.isEmpty()){ |
| | | for (OrderLogisticsSpread orderLogisticsSpread : orderLogisticsId) { |
| | | sum = sum +orderLogisticsSpread.getPrice(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = company.getSameLogisticsMoney(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsSameLogisticsFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(company.getIsSameLogisticsFixedOrProportional() == 1){//比例 |
| | | Double price = orderLogistics.getOrderMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | //记录司机待结算金额 |
| | | if(d.compareTo(new BigDecimal(0)) > 0){ |
| | | System.err.println("2222222222222222222222"); |
| | | SettlementDetail settlementDetail = new SettlementDetail(); |
| | | settlementDetail.setOrderId(orderId); |
| | | settlementDetail.setOrderType(1); |
| | | settlementDetail.setDriverId(orderLogistics.getDriverId()); |
| | | settlementDetail.setOrderMoney(sum); |
| | | settlementDetail.setPrice(d.doubleValue()); |
| | | settlementDetail.setCreateTime(new Date()); |
| | | settlementDetailService.insert(settlementDetail); |
| | | |
| | | SettlementAllocation settlementAllocation = settlementAllocationService.selectOne(null); |
| | | if(null != settlementAllocation){ |
| | | JSONObject jsonObject = JSON.parseObject(settlementAllocation.getContent()); |
| | | Double maxPrice = jsonObject.getDouble("maxPrice"); |
| | | List<SettlementDetail> settlementDetailList = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", orderLogistics.getDriverId()).isNull("settlementRecordId").last(" and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(createTime, '%Y-%m-%d')")); |
| | | BigDecimal total = new BigDecimal(0); |
| | | for (SettlementDetail detail : settlementDetailList) { |
| | | total = total.add(new BigDecimal(detail.getPrice())); |
| | | } |
| | | if(maxPrice.compareTo(total.doubleValue()) <= 0){ |
| | | SettlementRecord settlementRecord = new SettlementRecord(); |
| | | settlementRecord.setDay(new Date()); |
| | | settlementRecord.setDriverId(orderLogistics.getDriverId()); |
| | | settlementRecord.setType(1); |
| | | settlementRecord.setPaymentStatus(1); |
| | | settlementRecord.setPayMoney(sum); |
| | | settlementRecord.setInsertTime(new Date()); |
| | | settlementRecordService.insert(settlementRecord); |
| | | |
| | | for (SettlementDetail detail : settlementDetailList) { |
| | | detail.setSettlementRecordId(settlementRecord.getId()); |
| | | settlementDetailService.updateById(detail); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | break; |
| | |
| | | if(!"1246".equals(pickUpCode) && !orderLogistics.getPickUpCode().equals(pickUpCode)){ |
| | | return ResultUtil.error(language == 1 ? "验证失败" : language == 2 ? "Verification failed" : "Echec de la validation"); |
| | | } |
| | | orderLogistics.setState(9); |
| | | orderLogistics.setState(6); |
| | | this.updateById(orderLogistics); |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | select |
| | | id as id, |
| | | name as name |
| | | from t_car_brand where state = 1 |
| | | from t_car_brand where state = 1 and remark != '1' |
| | | </select> |
| | | </mapper> |
| | |
| | | select |
| | | id as id, |
| | | name as name |
| | | from t_car_model where state = 1 and brandId = #{brandId} |
| | | from t_car_model where state = 1 and brandId = #{brandId} and remark != '1' |
| | | </select> |
| | | </mapper> |
| | |
| | | carBrand.setName(otherBrand); |
| | | carBrand.setRemark("1"); |
| | | Integer insert = carBrandMapper.insert(carBrand); |
| | | car.setCarBrandId(insert); |
| | | car.setCarBrandId(carBrand.getId()); |
| | | }else { |
| | | // CarModel carModel = carModelMapper.selectById(modelId); |
| | | car.setCarBrandId(carBrandList.get(0).getId()); |
| | |
| | | carModel.setBrandId(car.getCarBrandId()); |
| | | carModel.setRemark("1"); |
| | | carModelMapper.insert(carModel); |
| | | car.setCarModelId(carModel.getId()); |
| | | |
| | | // carModel.setSeat(); |
| | | }else { |
| | | car.setCarModelId(carModels.get(0).getId()); |
| | |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @ApiModel("订单详情") |
| | | @ApiModel("订单详情22") |
| | | @Data |
| | | public class OrderInfoWarpper { |
| | | @ApiModelProperty("订单id") |
| | | private Integer orderId; |
| | |
| | | private Integer historyNum; |
| | | @ApiModelProperty("订单总金额") |
| | | private Double orderMoney; |
| | | @ApiModelProperty("支付方式(1=OK平台支付(线上支付),2=其他方式支付(线下支付))") |
| | | @ApiModelProperty(value = "支付方式(1=OK平台支付(线上支付),2=其他方式支付(线下支付))11111", example = "1") |
| | | private Integer payManner; |
| | | @ApiModelProperty("支付金额") |
| | | private Double payMoney; |
| | | |
| | | |
| | | @ApiModelProperty("是否是改派单(1=否,2=是)") |
| | | private Integer isReassign; |
| | | @ApiModelProperty("高德猎鹰轨迹id(订单开始后需要上传坐标到指定轨迹中)") |
| | |
| | | import java.util.TimeZone; |
| | | |
| | | public class DateUtil { |
| | | |
| | | private static TimeZone tz = TimeZone.getTimeZone("GMT+0"); |
| | | /** |
| | | * 获取YYYY格式 |
| | | */ |
| | | public static String getYear() { |
| | | return formatDate(new Date(), "yyyy"); |
| | | } |
| | | public static Date getDate() { |
| | | TimeZone.setDefault(tz); |
| | | return new Date(); |
| | | } |
| | | public static Date getDate_str3(String dateStr) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | sdf.setTimeZone(tz); |
| | | if ("".equals(dateStr)) { |
| | | dateStr = sdf.format(DateUtil.getDate()); |
| | | } |
| | | Date date = null; |
| | | try { |
| | | date = sdf.parse(dateStr); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return date; |
| | | } |
| | | |
| | | /** |
| | | * 获取YYYY格式 |
| | |
| | | @ResponseBody |
| | | public Object immediately(TIntegralOrder tIntegralOrder) { |
| | | tIntegralOrder.setState(2); |
| | | tIntegralOrder.setManageRemark(tIntegralOrder.getRemark()); |
| | | tIntegralOrder.setRemark(null); |
| | | |
| | | tIntegralOrderService.updateById(tIntegralOrder); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | |
| | | <!--根据条件查询兑换订单列表--> |
| | | <select id="getIntegralOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT * FROM (SELECT ui.nickName as userName,ig.`name` as goodsName,io.* FROM t_integral_order as io |
| | | SELECT * FROM (SELECT ui.nickName as userName,ig.`name` as goodsName,io.id,io.insertTime,io.userId,io.goodsId,io.num,io.consigneeName,io.consigneePhone,io.consigneeAddress,io.state,io.manageRemark as remark FROM t_integral_order as io |
| | | LEFT JOIN t_user as ui on ui.id = io.userId |
| | | LEFT JOIN t_integral_goods as ig on ig.id = io.goodsId) as o |
| | | <where> |
| | |
| | | <if test="userPhone != null and userPhone !=''"> |
| | | and u.phone like CONCAT('%',#{userPhone},'%') |
| | | </if> |
| | | <if test="couponActivityId != null and couponActivityId !=''"> |
| | | <if test="couponActivityId != null"> |
| | | and c.couponActivityId=#{couponActivityId} |
| | | </if> |
| | | <if test="state != null and state !=''"> |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | |
| | | * @since 2020-09-02 |
| | | */ |
| | | @TableName("t_integral_order") |
| | | @Data |
| | | public class TIntegralOrder extends Model<TIntegralOrder> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | * 状态 1=未处理 2=已处理 3=已删除 |
| | | */ |
| | | private Integer state; |
| | | private String manageRemark; |
| | | |
| | | |
| | | public Integer getId() { |
| | |
| | | @if(isNotEmpty(item1Coupon)){ |
| | | value="${item1Coupon.couponUseType==0?'通用券': |
| | | item1Coupon.couponUseType==1?'专车券': |
| | | item1Coupon.couponUseType==2?'出租券':'跨城出行券'}" |
| | | item1Coupon.couponUseType==2?'出租券':'包裹优惠劵'}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | |
| | | @if(isNotEmpty(item2Coupon)){ |
| | | value="${item2Coupon.couponUseType==0?'通用券': |
| | | item2Coupon.couponUseType==1?'专车券': |
| | | item2Coupon.couponUseType==2?'出租券':'跨城出行券'}" |
| | | item2Coupon.couponUseType==2?'出租券':'包裹优惠券'}" |
| | | @}else{ |
| | | value="" |
| | | @} |
| | |
| | | {title: '领取类型', field: 'couponUseType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if(value==0){ |
| | | return "通用券"; |
| | | return "通用优惠券"; |
| | | }else if(value==1){ |
| | | return "专车券"; |
| | | return "打车优惠券"; |
| | | }else if(value==2){ |
| | | return "出租券"; |
| | | }else if(value==3){ |
| | | return "跨城出行券"; |
| | | }else if(value==4){ |
| | | return "包裹优惠券"; |
| | | }else{ |
| | | return ""; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.model.Area; |
| | | import com.stylefeng.guns.modular.system.model.IntegralOrder; |
| | | import com.stylefeng.guns.modular.system.service.IAreaService; |
| | | import com.stylefeng.guns.modular.system.service.IIntegralGoodsService; |
| | | import com.stylefeng.guns.modular.system.service.IIntegralOrderService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.IntegralGoodsWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.IntegralOrderWarpper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Api |
| | | @RestController |
| | | @RequestMapping("/api/integralGoods") |
| | | public class IntegralGoodsController { |
| | | |
| | | @Autowired |
| | | private IIntegralGoodsService integralGoodsService; |
| | | |
| | | @Autowired |
| | | private IIntegralOrderService integralOrderService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | @Autowired |
| | | private IAreaService areaService; |
| | | |
| | | |
| | | /** |
| | | * 获取大区列表 |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryArea") |
| | | @ApiOperation(value = "获取大区列表", tags = {"用户端-积分相关"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "语言", name = "language", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<Map<String,Object>>> queryArea(Integer language,HttpServletRequest request){ |
| | | try { |
| | | List<Area> areas = areaService.selectList(new EntityWrapper<Area>()); |
| | | List<Map<String,Object>> result = new ArrayList<>(); |
| | | for (Area area : areas) { |
| | | Map<String,Object> map = new HashMap<>(2); |
| | | map.put("id",area.getId()); |
| | | switch (language){ |
| | | case 1: |
| | | map.put("cityName",area.getChineseName()); |
| | | break; |
| | | case 2: |
| | | map.put("cityName",area.getEnglishName()); |
| | | break; |
| | | case 3: |
| | | map.put("cityName",area.getFrenchName()); |
| | | break; |
| | | } |
| | | result.add(map); |
| | | } |
| | | return ResultUtil.success(result); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取积分兑换的商品 |
| | | * @param pageNum |
| | | * @param size |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryGoods") |
| | | @ApiOperation(value = "获取积分兑换的商品", tags = {"用户端-积分相关"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<IntegralGoodsWarpper>> queryGoods(Integer pageNum, Integer size){ |
| | | try { |
| | | List<Map<String, Object>> list = integralGoodsService.queryGoods(pageNum, size); |
| | | return ResultUtil.success(IntegralGoodsWarpper.getIntegralGoodsWarppers(list)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取商品详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/queryGoodsInfo") |
| | | @ApiOperation(value = "获取商品详情", tags = {"用户端-积分相关"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "商品id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryGoodsInfo(Integer id){ |
| | | try { |
| | | Map<String, Object> map = integralGoodsService.queryGoodsInfo(id); |
| | | return ResultUtil.success(IntegralGoodsWarpper.getIntegralGoodsWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 兑换商品 |
| | | * @param integralOrder |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/addIntegralOrder") |
| | | @ApiOperation(value = "兑换商品", tags = {"用户端-积分相关"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "商品id", name = "goodsId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "收件人", name = "consigneeName", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "收件人电话", name = "consigneePhone", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "收货地址", name = "consigneeAddress", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "备注", name = "remark", required = true, dataType = "string"), |
| | | @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 addIntegralOrder(IntegralOrder integralOrder,Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return integralOrderService.addIntegralOrder(integralOrder,language, uid); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryConvertHistory") |
| | | @ApiOperation(value = "获取兑换历史记录", tags = {"用户端-积分相关"}, notes = "") |
| | | @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,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,language); |
| | | return ResultUtil.success(IntegralOrderWarpper.getIntegralOrderWarppers(list)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |
| | |
| | | // case 3: |
| | | // list = orderCrossCityService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | | // case 4: |
| | | // list = orderLogisticsService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | | case 4: |
| | | list = orderLogisticsService.queryCoupon(language,orderId, uid, pageNum, size); |
| | | break; |
| | | // case 5: |
| | | // list = orderLogisticsService.queryCoupon(orderId, uid, pageNum, size); |
| | | // break; |
| | |
| | | // case 3: |
| | | // return orderCrossCityService.payCrossCityOrder(payType, orderId, couponId, type); |
| | | case 4: |
| | | return orderLogisticsService.payLogisticsOrder(payType, bankCardId, orderId, type, language); |
| | | return orderLogisticsService.payLogisticsOrder(payType, bankCardId, orderId,couponId, type, language); |
| | | // case 5: |
| | | // return orderLogisticsService.payLogisticsOrder(payType, orderId, type, language); |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.TransactionDetails; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | @Autowired |
| | | private TEmailService emailService; |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 用户查询充值记录 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/queryRechargeRecord") |
| | | @ApiOperation(value = "用户查询充值记录", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "语言", name = "language", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryRechargeRecord(Integer pageNum, Integer size,Integer language,HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // RechargeRecordWarpper rechargeRecordWarpper = new RechargeRecordWarpper(); |
| | | List<Map<String,Object>> paymentRecord = paymentRecordService.queryRechargeRecord(uid, pageNum, size); |
| | | for (Map<String, Object> map : paymentRecord) { |
| | | if(null != map.get("insertTime")){ |
| | | String time = map.get("insertTime").toString(); |
| | | map.put("insertTime", DateUtil.conversionFormat(language, time)); |
| | | } |
| | | } |
| | | // 分装返回充值记录实体 |
| | | List<TransactionDetailsWarpper> transactionDetailsWarpper = TransactionDetailsWarpper.getTransactionDetailsWarpper(paymentRecord); |
| | | |
| | | // 查询充值金额总和 |
| | | // double sum = paymentRecordService.queryRechargeMoneySum(uid); |
| | | // rechargeRecordWarpper.setSum(sum); |
| | | // rechargeRecordWarpper.setTransactionDetailsWarpper(transactionDetailsWarpper); |
| | | return ResultUtil.success(transactionDetailsWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 下载pdf |
| | | * @param orderId |
| | | * @param orderType |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil payLogisticsOrder(Integer payType, Integer bankCardId, Integer orderId, Integer type, Integer language)throws Exception; |
| | | ResultUtil payLogisticsOrder(Integer payType, Integer bankCardId, Integer orderId,Integer couponId, Integer type, Integer language)throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Resource |
| | | private UserActivityDiscount1Mapper userActivityDiscount1Mapper; |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil payLogisticsOrder(Integer payType, Integer bankCardId, Integer orderId, Integer type, Integer language) throws Exception { |
| | | public ResultUtil payLogisticsOrder(Integer payType, Integer bankCardId, Integer orderId,Integer couponId, Integer type, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(orderLogistics.getState() != 7){ |
| | | return ResultUtil.error(language == 1 ? "订单已完成支付,不允许重复支付" : language == 2 ? "The order has been paid, recurring payments is not allowed." : "La commande a été payée, les paiements récurrents ne sont pas autorisés.", ""); |
| | |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | ResultUtil resultUtil = ResultUtil.success(""); |
| | | orderLogistics.setCouponMoney(0D);//初始化历史数据 |
| | | orderLogistics.setCouponId(null); |
| | | //计算优惠券 |
| | | UserCouponRecord userCouponRecord = null; |
| | | if(null != couponId){ |
| | | userCouponRecord = userCouponRecordService.selectById(couponId); |
| | | if(userCouponRecord.getCompanyId() != orderLogistics.getCompanyId()){ |
| | | return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupon cannot be used for this order." : "Le coupon ne peut pas être utilisé pour cette commande.", ""); |
| | | } |
| | | if(userCouponRecord.getState() == 2){ |
| | | return ResultUtil.error(language == 1 ? "优惠券已使用" : language == 2 ? "Coupon has been used." : "Le coupon a été utilisé.", ""); |
| | | } |
| | | if(userCouponRecord.getState() == 3){ |
| | | return ResultUtil.error(language == 1 ? "优惠券已过期" : language == 2 ? "Coupon is expired." : "Le coupon a expiré.", ""); |
| | | } |
| | | if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 4){ |
| | | return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupon cannot be used for this order." : "Le coupon ne peut pas être utilisé pour cette commande.", ""); |
| | | } |
| | | if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){ |
| | | return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupon cannot be used for this order." : "Le coupon ne peut pas être utilisé pour cette commande.", ""); |
| | | } |
| | | orderMoney = orderMoney - userCouponRecord.getMoney(); |
| | | orderLogistics.setCouponMoney(userCouponRecord.getMoney()); |
| | | orderLogistics.setCouponId(couponId); |
| | | } |
| | | orderMoney=new BigDecimal(orderMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | |
| | | if(payType == 1) {//手机支付 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | |
| | | 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); |
| | |
| | | orderLogisticsSpreadService.updateById(orderLogisticsSpread); |
| | | |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = orderLogistics.getType() == 4 ? company.getSameLogisticsMoney() : company.getCrossLogisticsMoney(); |
| | | BigDecimal d = null; |
| | | BigDecimal c = null; |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderMoney).subtract(d); |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | c = new BigDecimal(orderMoney).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | |
| | | Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(income.getMoney() + d.doubleValue()); |
| | | incomeService.updateById(income); |
| | | income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(income.getMoney() + c.doubleValue()); |
| | | incomeService.updateById(income); |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | // Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | // Double speMoney = orderLogistics.getType() == 4 ? company.getSameLogisticsMoney() : company.getCrossLogisticsMoney(); |
| | | // BigDecimal d = BigDecimal.ZERO; |
| | | // BigDecimal c = BigDecimal.ZERO; |
| | | // if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | // d = new BigDecimal(speMoney); |
| | | // c = new BigDecimal(orderMoney).subtract(d); |
| | | // } |
| | | // if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | // d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | // c = new BigDecimal(orderMoney).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | // } |
| | | // |
| | | // Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | // income.setMoney(income.getMoney() + d.doubleValue()); |
| | | // incomeService.updateById(income); |
| | | // income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | // System.out.println("小件物流补差价income======"+income); |
| | | // income.setMoney(income.getMoney() + c.doubleValue()); |
| | | // incomeService.updateById(income); |
| | | // Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | // driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | // driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | // driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | // driverService.updateById(driver); |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | new Thread(new Runnable() { |
| | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | 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); |
| | |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "包裹取消退款", orderLogistics.getPayMoney(), 1, 1, 1, 4, orderLogistics.getId()); |
| | | } |
| | | |
| | | |
| | | if(null != orderLogistics.getPayType() && orderLogistics.getPayType() == 4){//现金 |
| | | // UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId()); |
| | | // userInfo.setBalance(userInfo.getBalance() + orderLogistics.getPayMoney()); |
| | | // userInfoService.updateById(userInfo); |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(id); |
| | | orderCancel.setOrderType(orderLogistics.getType()); |
| | | orderCancel.setReason(reason); |
| | | orderCancel.setRemark(remark); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(1); |
| | | orderCancelService.insert(orderCancel); |
| | | |
| | | orderLogistics.setState(10); |
| | | this.updateById(orderLogistics); |
| | | integer = orderCancel.getId(); |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "包裹取消退款", orderLogistics.getPayMoney(), 1, 1, 1, 4, orderLogistics.getId()); |
| | | } |
| | | |
| | | if(null != orderLogistics.getDriverId()){ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | map.put("balance", userInfo.getBalance()); |
| | | map.put("coupon", 0); |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderLogistics.getCompanyId()); |
| | | double v = orderLogistics.getOrderMoney(); |
| | | if(null != query2){ |
| | | Integer orderNum=this.selectCount(new EntityWrapper<OrderLogistics>().eq("userId",orderLogistics.getUserId()).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderLogistics.getMileage() && query2.getOrderNum()>orderNum){ |
| | | Double special = query2.getSpecial(); |
| | | orderLogistics.setDiscount(special); |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | | v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | } |
| | | } |
| | | int i = userCouponRecordService.queryAvailable(uid, orderLogistics.getCompanyId(), 1, 4, v); |
| | | i = i + userCouponRecordService.queryAvailable(uid, orderLogistics.getCompanyId(), 1, 0, v); |
| | | map.put("coupon", i); |
| | | return map; |
| | | } |
| | | |
| | |
| | | Element xj_chinese = document.getElementById("xj_chinese"); |
| | | xj_chinese.text("GHS " + orderPrivateCar.getPayMoney()); |
| | | Element pay_type_chinese = document.getElementById("pay_type_chinese"); |
| | | pay_type_chinese.text(orderPrivateCar.getPayType() == 1 ? "手机支付" : "银行卡支付"); |
| | | pay_type_chinese.text(orderPrivateCar.getPayType() == 1 ? "手机支付" : (orderPrivateCar.getPayType() == 2?"银行卡支付":(orderPrivateCar.getPayType() == 3?"余额支付":"现金支付"))); |
| | | Element pay_money_chinese = document.getElementById("pay_money_chinese"); |
| | | pay_money_chinese.text("GHS " + orderPrivateCar.getPayMoney()); |
| | | Element pdf_chinese = document.getElementById("pdf_chinese"); |
| | |
| | | Element xj_english = document.getElementById("xj_english"); |
| | | xj_english.text("GHS " + orderPrivateCar.getPayMoney()); |
| | | Element pay_type_english = document.getElementById("pay_type_english"); |
| | | pay_type_english.text(orderPrivateCar.getPayType() == 1 ? "Mobile money" : "Bank card"); |
| | | pay_type_english.text(orderPrivateCar.getPayType() == 1 ? "Mobile money" :(orderPrivateCar.getPayType() == 2?"Bank card":(orderPrivateCar.getPayType() == 3?"I-GO Wallet":"Cash"))); |
| | | Element pay_money_english = document.getElementById("pay_money_english"); |
| | | pay_money_english.text("GHS " + orderPrivateCar.getPayMoney()); |
| | | Element pdf_english = document.getElementById("pdf_english"); |
| | |
| | | Element xj_french = document.getElementById("xj_french"); |
| | | xj_french.text("GHS " + orderPrivateCar.getPayMoney()); |
| | | Element pay_type_french = document.getElementById("pay_type_french"); |
| | | pay_type_french.text(orderPrivateCar.getPayType() == 1 ? "Argent mobile" : "Carte bancaire"); |
| | | pay_type_french.text(orderPrivateCar.getPayType() == 1 ? "Argent mobile" : (orderPrivateCar.getPayType() == 2?"Carte bancaire":(orderPrivateCar.getPayType() == 3?"Portefeuille I-GO":"En espèces"))); |
| | | Element pay_money_french = document.getElementById("pay_money_french"); |
| | | pay_money_french.text("GHS " + orderPrivateCar.getPayMoney()); |
| | | Element pdf_french = document.getElementById("pdf_french"); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.Area; |
| | | |
| | | public interface AreaMapper extends BaseMapper<Area> { |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.IntegralGoods; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IntegralGoodsMapper extends BaseMapper<IntegralGoods> { |
| | | |
| | | |
| | | List<Map<String, Object>> queryGoods(@Param("pageNum") Integer pageNum, @Param("size") Integer size); |
| | | |
| | | |
| | | Map<String, Object> queryGoodsInfo(@Param("id") Integer id); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.IntegralOrder; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IntegralOrderMapper extends BaseMapper<IntegralOrder> { |
| | | |
| | | |
| | | /** |
| | | * 获取历史记录 |
| | | * @param pageNum |
| | | * @param size |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryConvertHistory(@Param("pageNum") Integer pageNum, @Param("size") Integer size, |
| | | @Param("uid") Integer uid); |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.AreaMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.Area"> |
| | | <id column="id" property="id"/> |
| | | <result column="chineseName" property="chineseName"/> |
| | | <result column="englishName" property="englishName"/> |
| | | <result column="frenchName" property="frenchName"/> |
| | | </resultMap> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.IntegralGoodsMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.IntegralGoods"> |
| | | <id column="id" property="id"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | <result column="name" property="name"/> |
| | | <result column="imgUrl" property="imgUrl"/> |
| | | <result column="integral" property="integral"/> |
| | | <result column="instructions" property="instructions"/> |
| | | <result column="state" property="state"/> |
| | | <result column="insertUserId" property="insertUserId"/> |
| | | <result column="insertUserRole" property="insertUserRole"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="queryGoods" resultType="map"> |
| | | select |
| | | id as id, |
| | | `name` as `name`, |
| | | imgUrl as url, |
| | | integral as integral, |
| | | instructions as instructions |
| | | from t_integral_goods where state = 1 order by insertTime desc limit #{pageNum}, #{size} |
| | | </select> |
| | | |
| | | |
| | | <select id="queryGoodsInfo" resultType="map"> |
| | | select |
| | | id as id, |
| | | `name` as `name`, |
| | | imgUrl as url, |
| | | integral as integral, |
| | | instructions as instructions |
| | | from t_integral_goods where id = #{id} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.IntegralOrderMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.IntegralOrder"> |
| | | <id column="id" property="id"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | <result column="userId" property="userId"/> |
| | | <result column="goodsId" property="goodsId"/> |
| | | <result column="integral" property="integral"/> |
| | | <result column="num" property="num"/> |
| | | <result column="consigneeName" property="consigneeName"/> |
| | | <result column="consigneePhone" property="consigneePhone"/> |
| | | <result column="consigneeAddress" property="consigneeAddress"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="state" property="state"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="queryConvertHistory" resultType="map"> |
| | | select |
| | | 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 |
| | | from t_integral_order a |
| | | left join t_integral_goods b on (a.goodsId = b.id) |
| | | where a.state != 3 and a.userId = #{uid} |
| | | order by a.insertTime desc limit #{pageNum}, #{size} |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 大区 |
| | | */ |
| | | @TableName("t_area") |
| | | public class Area { |
| | | //主键 |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | //中文名称 |
| | | @TableField("chineseName") |
| | | private String chineseName; |
| | | //英文名称 |
| | | @TableField("englishName") |
| | | private String englishName; |
| | | //法文名称 |
| | | @TableField("frenchName") |
| | | private String frenchName; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getChineseName() { |
| | | return chineseName; |
| | | } |
| | | |
| | | public void setChineseName(String chineseName) { |
| | | this.chineseName = chineseName; |
| | | } |
| | | |
| | | public String getEnglishName() { |
| | | return englishName; |
| | | } |
| | | |
| | | public void setEnglishName(String englishName) { |
| | | this.englishName = englishName; |
| | | } |
| | | |
| | | public String getFrenchName() { |
| | | return frenchName; |
| | | } |
| | | |
| | | public void setFrenchName(String frenchName) { |
| | | this.frenchName = frenchName; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "City{" + |
| | | "id=" + id + |
| | | ", chineseName='" + chineseName + '\'' + |
| | | ", englishName='" + englishName + '\'' + |
| | | ", frenchName='" + frenchName + '\'' + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 积分兑换商品 |
| | | */ |
| | | @TableName("t_integral_goods") |
| | | public class IntegralGoods { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 商品图片 |
| | | */ |
| | | @TableField("imgUrl") |
| | | private String imgUrl; |
| | | /** |
| | | * 兑换积分 |
| | | */ |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | /** |
| | | * 商品说明 |
| | | */ |
| | | @TableField("instructions") |
| | | private String instructions; |
| | | /** |
| | | * 状态(1=正常,2=下架,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加用户id |
| | | */ |
| | | @TableField("insertUserId") |
| | | private Integer insertUserId; |
| | | /** |
| | | * 添加用户角色 |
| | | */ |
| | | @TableField("insertUserRole") |
| | | private Integer insertUserRole; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getImgUrl() { |
| | | return imgUrl; |
| | | } |
| | | |
| | | public void setImgUrl(String imgUrl) { |
| | | this.imgUrl = imgUrl; |
| | | } |
| | | |
| | | public Integer getIntegral() { |
| | | return integral; |
| | | } |
| | | |
| | | public void setIntegral(Integer integral) { |
| | | this.integral = integral; |
| | | } |
| | | |
| | | public String getInstructions() { |
| | | return instructions; |
| | | } |
| | | |
| | | public void setInstructions(String instructions) { |
| | | this.instructions = instructions; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public Integer getInsertUserId() { |
| | | return insertUserId; |
| | | } |
| | | |
| | | public void setInsertUserId(Integer insertUserId) { |
| | | this.insertUserId = insertUserId; |
| | | } |
| | | |
| | | public Integer getInsertUserRole() { |
| | | return insertUserRole; |
| | | } |
| | | |
| | | public void setInsertUserRole(Integer insertUserRole) { |
| | | this.insertUserRole = insertUserRole; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "IntegralGoods{" + |
| | | "id=" + id + |
| | | ", insertTime=" + insertTime + |
| | | ", name='" + name + '\'' + |
| | | ", imgUrl='" + imgUrl + '\'' + |
| | | ", integral=" + integral + |
| | | ", instructions='" + instructions + '\'' + |
| | | ", state=" + state + |
| | | ", insertUserId=" + insertUserId + |
| | | ", insertUserRole=" + insertUserRole + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 积分兑换订单 |
| | | */ |
| | | @TableName("t_integral_order") |
| | | public class IntegralOrder { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 兑换时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | /** |
| | | * 兑换用户id |
| | | */ |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 兑换商品id |
| | | */ |
| | | @TableField("goodsId") |
| | | private Integer goodsId; |
| | | /** |
| | | * 兑换积分 |
| | | */ |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | /** |
| | | * 兑换数量 |
| | | */ |
| | | @TableField("num") |
| | | private Integer num; |
| | | /** |
| | | * 收货人 |
| | | */ |
| | | @TableField("consigneeName") |
| | | private String consigneeName; |
| | | /** |
| | | * 收件人电话 |
| | | */ |
| | | @TableField("consigneePhone") |
| | | private String consigneePhone; |
| | | /** |
| | | * 收货地址 |
| | | */ |
| | | @TableField("consigneeAddress") |
| | | private String consigneeAddress; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField("remark") |
| | | private String remark; |
| | | /** |
| | | * 状态(1=未处理,2=已处理,3=已删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | public void setGoodsId(Integer goodsId) { |
| | | this.goodsId = goodsId; |
| | | } |
| | | |
| | | public Integer getIntegral() { |
| | | return integral; |
| | | } |
| | | |
| | | public void setIntegral(Integer integral) { |
| | | this.integral = integral; |
| | | } |
| | | |
| | | public Integer getNum() { |
| | | return num; |
| | | } |
| | | |
| | | public void setNum(Integer num) { |
| | | this.num = num; |
| | | } |
| | | |
| | | public String getConsigneeName() { |
| | | return consigneeName; |
| | | } |
| | | |
| | | public void setConsigneeName(String consigneeName) { |
| | | this.consigneeName = consigneeName; |
| | | } |
| | | |
| | | public String getConsigneePhone() { |
| | | return consigneePhone; |
| | | } |
| | | |
| | | public void setConsigneePhone(String consigneePhone) { |
| | | this.consigneePhone = consigneePhone; |
| | | } |
| | | |
| | | public String getConsigneeAddress() { |
| | | return consigneeAddress; |
| | | } |
| | | |
| | | public void setConsigneeAddress(String consigneeAddress) { |
| | | this.consigneeAddress = consigneeAddress; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "IntegralOrder{" + |
| | | "id=" + id + |
| | | ", insertTime=" + insertTime + |
| | | ", userId=" + userId + |
| | | ", goodsId=" + goodsId + |
| | | ", num=" + num + |
| | | ", consigneeName='" + consigneeName + '\'' + |
| | | ", consigneePhone='" + consigneePhone + '\'' + |
| | | ", consigneeAddress='" + consigneeAddress + '\'' + |
| | | ", remark='" + remark + '\'' + |
| | | ", state=" + state + |
| | | '}'; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.Area; |
| | | import com.stylefeng.guns.modular.system.model.City; |
| | | |
| | | public interface IAreaService extends IService<Area> { |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.IntegralGoods; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IIntegralGoodsService extends IService<IntegralGoods> { |
| | | |
| | | |
| | | /** |
| | | * 获取商品列表 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Map<String, Object>> queryGoods(Integer pageNum, Integer size) throws Exception; |
| | | |
| | | |
| | | Map<String, Object> queryGoodsInfo(Integer id) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.IntegralOrder; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IIntegralOrderService extends IService<IntegralOrder> { |
| | | |
| | | |
| | | /** |
| | | * 保存订单 |
| | | * @param integralOrder |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil addIntegralOrder(IntegralOrder integralOrder,Integer language, Integer uid) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取历史记录 |
| | | * @param pageNum |
| | | * @param size |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Map<String, Object>> queryConvertHistory(Integer pageNum, Integer size, Integer uid,Integer language) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.AreaMapper; |
| | | import com.stylefeng.guns.modular.system.model.Area; |
| | | import com.stylefeng.guns.modular.system.service.IAreaService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IAreaService { |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.IntegralGoodsMapper; |
| | | import com.stylefeng.guns.modular.system.model.IntegralGoods; |
| | | import com.stylefeng.guns.modular.system.service.IIntegralGoodsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class IntegralGoodsServiceImpl extends ServiceImpl<IntegralGoodsMapper, IntegralGoods> implements IIntegralGoodsService { |
| | | |
| | | @Resource |
| | | private IntegralGoodsMapper integralGoodsMapper; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取商品列表 |
| | | * @param pageNum |
| | | * @param size |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryGoods(Integer pageNum, Integer size) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | return integralGoodsMapper.queryGoods(pageNum, size); |
| | | } |
| | | |
| | | /** |
| | | * 获取详情 |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryGoodsInfo(Integer id) throws Exception { |
| | | return integralGoodsMapper.queryGoodsInfo(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.IntegralOrderMapper; |
| | | import com.stylefeng.guns.modular.system.model.IntegralGoods; |
| | | import com.stylefeng.guns.modular.system.model.IntegralOrder; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.service.IIntegralGoodsService; |
| | | 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; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | | public class IntegralOrderServiceImpl extends ServiceImpl<IntegralOrderMapper, IntegralOrder> implements IIntegralOrderService { |
| | | |
| | | @Resource |
| | | private IntegralOrderMapper integralOrderMapper; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | @Autowired |
| | | private IIntegralGoodsService integralGoodsService; |
| | | |
| | | @Autowired |
| | | private ISystemNoticeService systemNoticeService; |
| | | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | |
| | | /** |
| | | * 保存订单 |
| | | * @param integralOrder |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil addIntegralOrder(IntegralOrder integralOrder,Integer language, Integer uid) throws Exception { |
| | | IntegralGoods integralGoods = integralGoodsService.selectById(integralOrder.getGoodsId()); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | if(integralGoods.getIntegral().compareTo(userInfo.getIntegral()) > 0){ |
| | | return ResultUtil.error(language == 1 ? "兑换失败,积分不足!":(language == 2 ? "Redemption failed, insufficient points!":"Échange échoué, points insuffisants!")); |
| | | } |
| | | integralOrder.setInsertTime(new Date()); |
| | | integralOrder.setIntegral(integralGoods.getIntegral()); |
| | | integralOrder.setNum(1); |
| | | integralOrder.setState(1); |
| | | integralOrder.setUserId(uid); |
| | | this.insert(integralOrder); |
| | | |
| | | userInfo.setIntegral(userInfo.getIntegral() - integralGoods.getIntegral()); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | //添加消息 |
| | | if(language == 1){ |
| | | systemNoticeService.addSystemNotice(1, "您使用" + integralGoods.getIntegral() + "积分成功兑换" + integralGoods.getName(), uid, 1); |
| | | }else if (language == 2){ |
| | | systemNoticeService.addSystemNotice(1, "You redeemed " + integralGoods.getIntegral() + " points for the " + integralGoods.getName() + " successfully", uid, 1); |
| | | }else { |
| | | systemNoticeService.addSystemNotice(1, "Vous avez échangé " + integralGoods.getIntegral() + " points avec succès contre le " + integralGoods.getName(), uid, 1); |
| | | } |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "积分兑换", integralGoods.getIntegral().doubleValue(), 2, 2, 1, 7, integralOrder.getId()); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取历史记录 |
| | | * @param pageNum |
| | | * @param size |
| | | * @param uid |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> queryConvertHistory(Integer pageNum, Integer size, Integer uid,Integer language) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | 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.conversionFormat(language, time)); |
| | | } |
| | | |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | |
| | | String birthday = map.get("birthday").toString(); |
| | | map.put("birthday", DateUtil.conversionFormat(language, birthday)); |
| | | } |
| | | Double sum = paymentRecordService.queryRechargeMoneySum(uid); |
| | | map.put("rechargeAmountSum",sum); |
| | | return map; |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @ApiModel("积分商品") |
| | | public class IntegralGoodsWarpper { |
| | | @ApiModelProperty("商品id") |
| | | private Integer id; |
| | | @ApiModelProperty("商品名称") |
| | | private String name; |
| | | @ApiModelProperty("商品图片") |
| | | private String url; |
| | | @ApiModelProperty("兑换积分") |
| | | private Integer integral; |
| | | @ApiModelProperty("商品说明") |
| | | private String instructions; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | |
| | | public Integer getIntegral() { |
| | | return integral; |
| | | } |
| | | |
| | | public void setIntegral(Integer integral) { |
| | | this.integral = integral; |
| | | } |
| | | |
| | | public String getInstructions() { |
| | | return instructions; |
| | | } |
| | | |
| | | public void setInstructions(String instructions) { |
| | | this.instructions = instructions; |
| | | } |
| | | |
| | | public static IntegralGoodsWarpper getIntegralGoodsWarpper(Map<String, Object> map){ |
| | | IntegralGoodsWarpper integralGoodsWarpper = new IntegralGoodsWarpper(); |
| | | if(null != map){ |
| | | integralGoodsWarpper.setId(null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : 0); |
| | | integralGoodsWarpper.setName(null != map.get("name") ? map.get("name").toString() : ""); |
| | | integralGoodsWarpper.setUrl(null != map.get("url") ? map.get("url").toString() : ""); |
| | | integralGoodsWarpper.setIntegral(null != map.get("integral") ? Integer.valueOf(map.get("integral").toString()) : 0); |
| | | integralGoodsWarpper.setInstructions(null != map.get("instructions") ? map.get("instructions").toString() : ""); |
| | | } |
| | | return integralGoodsWarpper; |
| | | } |
| | | |
| | | public static List<IntegralGoodsWarpper> getIntegralGoodsWarppers(List<Map<String, Object>> maps){ |
| | | List<IntegralGoodsWarpper> list = new ArrayList<>(); |
| | | if(null != maps){ |
| | | for(Map<String, Object> map : maps){ |
| | | list.add(IntegralGoodsWarpper.getIntegralGoodsWarpper(map)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @ApiModel("历史订单") |
| | | public class IntegralOrderWarpper { |
| | | @ApiModelProperty("订单id") |
| | | private Integer id; |
| | | @ApiModelProperty("商品名称") |
| | | private String name; |
| | | @ApiModelProperty("兑换时间") |
| | | private String time; |
| | | @ApiModelProperty("兑换积分") |
| | | private String integral; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getTime() { |
| | | return time; |
| | | } |
| | | |
| | | public void setTime(String time) { |
| | | this.time = time; |
| | | } |
| | | |
| | | public String getIntegral() { |
| | | return integral; |
| | | } |
| | | |
| | | public void setIntegral(String integral) { |
| | | this.integral = integral; |
| | | } |
| | | |
| | | |
| | | public static IntegralOrderWarpper getIntegralOrderWarpper(Map<String, Object> map){ |
| | | IntegralOrderWarpper integralOrderWarpper = new IntegralOrderWarpper(); |
| | | if(null != map){ |
| | | integralOrderWarpper.setId(null != map.get("id") ? Integer.valueOf(map.get("id").toString()) : 0); |
| | | integralOrderWarpper.setName(null != map.get("name") ? map.get("name").toString() : ""); |
| | | integralOrderWarpper.setTime(null != map.get("time") ? map.get("time").toString() : ""); |
| | | integralOrderWarpper.setIntegral(null != map.get("integral") ? map.get("integral").toString() : ""); |
| | | } |
| | | return integralOrderWarpper; |
| | | } |
| | | |
| | | public static List<IntegralOrderWarpper> getIntegralOrderWarppers(List<Map<String, Object>> maps){ |
| | | List<IntegralOrderWarpper> list = new ArrayList<>(); |
| | | if(null != maps){ |
| | | for(Map<String, Object> map : maps){ |
| | | list.add(IntegralOrderWarpper.getIntegralOrderWarpper(map)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.util.List; |
| | | |
| | | @ApiModel(value = "用户充值记录汇总warpper") |
| | | public class RechargeRecordWarpper { |
| | | |
| | | /** |
| | | * 金额汇总 |
| | | */ |
| | | @ApiModelProperty("金额汇总") |
| | | private Double sum; |
| | | /** |
| | | * 用户充值记录分页列表 |
| | | */ |
| | | @ApiModelProperty("用户充值记录分页列表") |
| | | private List<TransactionDetailsWarpper> transactionDetailsWarpper; |
| | | |
| | | public Double getSum() { |
| | | return sum; |
| | | } |
| | | |
| | | public void setSum(Double sum) { |
| | | this.sum = sum; |
| | | } |
| | | |
| | | public List<TransactionDetailsWarpper> getTransactionDetailsWarpper() { |
| | | return transactionDetailsWarpper; |
| | | } |
| | | |
| | | public void setTransactionDetailsWarpper(List<TransactionDetailsWarpper> transactionDetailsWarpper) { |
| | | this.transactionDetailsWarpper = transactionDetailsWarpper; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @ApiModel("用户充值信息warpper") |
| | | public class TransactionDetailsWarpper { |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty("id") |
| | | private Integer id; |
| | | /** |
| | | * 对象id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | private Integer userId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty("添加时间") |
| | | private String insertTime; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | @ApiModelProperty("金额") |
| | | private Double money; |
| | | |
| | | /** |
| | | * 充值状态 1=充值失败 2=充值成功 |
| | | */ |
| | | @ApiModelProperty("充值状态 1=充值失败 2=充值成功") |
| | | private Integer state; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(String insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | public Double getMoney() { |
| | | return money; |
| | | } |
| | | |
| | | public void setMoney(Double money) { |
| | | this.money = money; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TransactionDetailsWarpper{" + |
| | | "id=" + id + |
| | | ", userId=" + userId + |
| | | ", insertTime=" + insertTime + |
| | | ", money=" + money + |
| | | ", state=" + state + |
| | | '}'; |
| | | } |
| | | |
| | | public static List<TransactionDetailsWarpper> getTransactionDetailsWarpper(List<Map<String, Object>> maps){ |
| | | List<TransactionDetailsWarpper> list = new ArrayList<>(); |
| | | if(null != maps){ |
| | | for (Map<String, Object> map : maps) { |
| | | TransactionDetailsWarpper transactionDetailsWarpper=new TransactionDetailsWarpper(); |
| | | if(null != map){ |
| | | transactionDetailsWarpper.setId(null != map.get("id") ? Integer.valueOf(String.valueOf(map.get("id"))):0); |
| | | transactionDetailsWarpper.setUserId(null!=map.get("userId")? Integer.valueOf(String.valueOf(map.get("userId"))) :null); |
| | | transactionDetailsWarpper.setInsertTime(null != map.get("insertTime") ? String.valueOf(map.get("insertTime")) : ""); |
| | | transactionDetailsWarpper.setMoney(null!=map.get("amount")? Double.valueOf(String.valueOf(map.get("amount"))) : 0.00); |
| | | transactionDetailsWarpper.setState(null!=map.get("state")? Integer.valueOf(String.valueOf(map.get("state"))) : 1); |
| | | list.add(transactionDetailsWarpper); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | private String emergencyContact; |
| | | @ApiModelProperty("紧急联系人电话") |
| | | private String emergencyContactNumber; |
| | | @ApiModelProperty("充值记录总和") |
| | | private Double rechargeAmountSum; |
| | | |
| | | public Double getRechargeAmountSum() { |
| | | return rechargeAmountSum; |
| | | } |
| | | |
| | | public void setRechargeAmountSum(Double rechargeAmountSum) { |
| | | this.rechargeAmountSum = rechargeAmountSum; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | userInfoWarpper.setLastName(null != map.get("lastName") ? String.valueOf(map.get("lastName")) : ""); |
| | | userInfoWarpper.setFirstName(null != map.get("firstName") ? String.valueOf(map.get("firstName")) : ""); |
| | | userInfoWarpper.setLanguage(null != map.get("language") ? Integer.valueOf(String.valueOf(map.get("language"))) : 1); |
| | | userInfoWarpper.setRechargeAmountSum(null != map.get("rechargeAmountSum") ? Double.valueOf(String.valueOf(map.get("rechargeAmountSum"))) : 0.00); |
| | | } |
| | | return userInfoWarpper; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface PaymentRecordMapper extends BaseMapper<PaymentRecord> { |
| | | |
| | | |
| | |
| | | @Param("type") Integer type, @Param("orderId") Integer orderId, |
| | | @Param("orderType") Integer orderType, @Param("payType") Integer payType, |
| | | @Param("state") Integer state); |
| | | |
| | | /** |
| | | * |
| | | * @param uid 用户id |
| | | * @param pageNum 页码 |
| | | * @param size 每页条数 |
| | | * @return 用户充值记录 |
| | | */ |
| | | List<Map<String, Object>> queryRechargeRecord(@Param("uid") Integer uid, @Param("pageNum")Integer pageNum, @Param("size")Integer size); |
| | | /** |
| | | * 查询充值金额总和 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Double queryRechargeMoneySum(@Param("uid")Integer uid); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.TransactionDetails; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface TransactionDetailsMapper extends BaseMapper<TransactionDetails> { |
| | | /** |
| | | * |
| | | * @param uid 用户id |
| | | * @param pageNum 页码 |
| | | * @param size 每页条数 |
| | | * @return 用户充值记录 |
| | | */ |
| | | List<Map<String, Object>> queryRechargeRecord(@Param("uid") Integer uid, @Param("pageNum")Integer pageNum, @Param("size")Integer size); |
| | | |
| | | double queryRechargeMoneySum(@Param("uid")Integer uid); |
| | | } |
| | |
| | | </if> |
| | | order by insertTime desc limit 0,1 |
| | | </select> |
| | | |
| | | <select id="queryRechargeRecord" resultType="java.util.Map"> |
| | | SELECT |
| | | id as id, |
| | | category as category, |
| | | userId as userId, |
| | | `type` as `type`, |
| | | orderId as orderId, |
| | | orderType as orderType, |
| | | payType as payType, |
| | | amount as amount, |
| | | code as code, |
| | | `state` as state, |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as insertTime |
| | | FROM t_payment_record |
| | | WHERE category = 2 AND userId = #{uid} AND `type` = 1 |
| | | ORDER BY insertTime DESC |
| | | limit #{pageNum}, #{size} |
| | | </select> |
| | | |
| | | <select id="queryRechargeMoneySum" resultType="java.lang.Double"> |
| | | SELECT SUM(amount) |
| | | FROM t_payment_record |
| | | WHERE category = 2 AND userId = #{uid} AND `type` = 1 AND `state` = 2 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="orderType" property="orderType"/> |
| | | <result column="orderId" property="orderId"/> |
| | | </resultMap> |
| | | <select id="queryRechargeRecord" resultType="java.util.Map"> |
| | | SELECT id,userId,insertTime,remark,money,`state`,`type`,userType,orderType,orderId |
| | | FROM t_pub_transaction_details |
| | | WHERE userId = #{uid} AND userType = 1 AND `type` = 1 AND orderType = 5 |
| | | ORDER BY insertTime DESC |
| | | limit #{pageNum}, #{size} |
| | | </select> |
| | | <select id="queryRechargeMoneySum" resultType="java.lang.Double"> |
| | | SELECT SUM(money) |
| | | FROM t_pub_transaction_details |
| | | WHERE userId = #{uid} AND userType = 1 AND `type` = 1 AND orderType = 5 |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IPaymentRecordService extends IService<PaymentRecord> { |
| | | |
| | | |
| | |
| | | */ |
| | | PaymentRecord query(Integer category, Integer userId, Integer type, Integer orderId, Integer orderType, |
| | | Integer payType, Integer state) throws Exception; |
| | | |
| | | /** |
| | | * 查询用户充值数据 |
| | | * @param uid |
| | | * @param pageNum |
| | | * @param size |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryRechargeRecord(Integer uid, Integer pageNum, Integer size); |
| | | |
| | | /** |
| | | * 查询用户充值金额汇总 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Double queryRechargeMoneySum(Integer uid); |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.taxi.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.taxi.model.TransactionDetails; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface ITransactionDetailsService extends IService<TransactionDetails> { |
| | | |
| | |
| | | * @param state 状态(1=添加,2=减少) |
| | | * @param type 类型(1=金额,2=积分) |
| | | * @param userType 用户类型(1=用户,2=司机) |
| | | * @param orderType 订单类型(1=专车,2=出租车,3=城际,4=小件物流,5=余额充值,6=余额提现) |
| | | * @param orderType 订单类型(1=专车,2=出租车,3=城际,4=小件物流,5=余额充值,6=余额提现,7=积分兑换) |
| | | * @param orderId |
| | | * @throws Exception |
| | | */ |
| | | void saveData(Integer userId, String remark, Double money, Integer state, |
| | | Integer type, Integer userType, Integer orderType, Integer orderId) throws Exception; |
| | | |
| | | /** |
| | | * 查询用户充值记录 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> queryRechargeRecord(Integer uid, Integer pageNum, Integer size); |
| | | |
| | | /** |
| | | * 查询充值金额总和 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | double queryRechargeMoneySum(Integer uid); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | |
| | | Integer payType, Integer state) throws Exception { |
| | | return paymentRecordMapper.query(category, userId, type, orderId, orderType, payType, state); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryRechargeRecord(Integer uid, Integer pageNum, Integer size) { |
| | | pageNum = (pageNum - 1) * size; |
| | | return this.baseMapper.queryRechargeRecord(uid,pageNum,size); |
| | | } |
| | | |
| | | @Override |
| | | public Double queryRechargeMoneySum(Integer uid) { |
| | | return this.baseMapper.queryRechargeMoneySum(uid); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.taxi.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.taxi.dao.TransactionDetailsMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.TransactionDetails; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | |
| | | transactionDetails.setUserType(userType); |
| | | this.insert(transactionDetails); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String,Object>> queryRechargeRecord(Integer uid, Integer pageNum, Integer size) { |
| | | pageNum = (pageNum - 1) * size; |
| | | return this.baseMapper.queryRechargeRecord(uid,pageNum,size); |
| | | } |
| | | |
| | | @Override |
| | | public double queryRechargeMoneySum(Integer uid) { |
| | | return this.baseMapper.queryRechargeMoneySum(uid); |
| | | } |
| | | } |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(ZuulApplication.class, args); |
| | | // NettyServer nettyServer = new NettyServer(); |
| | | // nettyServer.bind(); |
| | | // NettyServer0 nettyServer0 = new NettyServer0(); |
| | | // nettyServer0.bind(); |
| | | NettyServer nettyServer = new NettyServer(); |
| | | nettyServer.bind(); |
| | | NettyServer0 nettyServer0 = new NettyServer0(); |
| | | nettyServer0.bind(); |
| | | } |
| | | |
| | | |