| @@ -32,6 +32,7 @@ public class WxCUserCarController extends BaseController { | |||||
| public ResultData list(@ModelAttribute WxCUserCar wxCUserCar, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCUserCar wxCUserCar, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxCUserCarController::list"); | logger.debug("[" + getIpAddr() + "] WxCUserCarController::list"); | ||||
| if (null == wxCUserCar) wxCUserCar = new WxCUserCar(); | if (null == wxCUserCar) wxCUserCar = new WxCUserCar(); | ||||
| wxCUserCar.updateTenantInfo(getTenantInfo()); | |||||
| final PageInfo<WxCUserCar> page = wxCUserCarService.listAsPage(wxCUserCar, pageNum, pageSize); | final PageInfo<WxCUserCar> page = wxCUserCarService.listAsPage(wxCUserCar, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -9,11 +9,15 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxCreditHistory; | import com.iformall.domain.po.WxCreditHistory; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxCreditHistoryVo; | import com.iformall.domain.vo.WxCreditHistoryVo; | ||||
| import com.iformall.enums.EnumMerchantStatus; | |||||
| import com.iformall.enums.EnumScoreType; | |||||
| import com.iformall.enums.EnumUserType; | import com.iformall.enums.EnumUserType; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.WxCreditHistoryService; | import com.iformall.service.WxCreditHistoryService; | ||||
| import com.iformall.service.WxMerchantService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -34,7 +38,10 @@ public class WxCreditHistoryController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| private WxCreditHistoryService wxCreditHistoryService; | |||||
| WxCreditHistoryService wxCreditHistoryService; | |||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -87,6 +94,19 @@ public class WxCreditHistoryController extends BaseController { | |||||
| wxCreditHistory.setOperatorId(user.getId()); | wxCreditHistory.setOperatorId(user.getId()); | ||||
| wxCreditHistory.setOperatorType(EnumUserType.MALLUSER.getCode()); | wxCreditHistory.setOperatorType(EnumUserType.MALLUSER.getCode()); | ||||
| String desc = ""; | |||||
| if(wxCreditHistory.getCreditType().equals(EnumScoreType.SPEND_CREDIT.getCode())){ | |||||
| WxMerchant byId = wxMerchantService.getById(wxCreditHistory.getMerchantId()); | |||||
| desc = "A端("+user.getUsername()+")操作新增商户("+byId.getName()+")消费("+wxCreditHistory.getSpendStr()+"元)积分"; | |||||
| }else if(wxCreditHistory.getCreditType().equals(EnumScoreType.REDUCE_CREDIT.getCode())){ | |||||
| desc = "A端("+user.getUsername()+")操作积分兑换"; | |||||
| if(StringUtils.isNotBlank(wxCreditHistory.getChangePurpose())){ | |||||
| desc = desc + "("+wxCreditHistory.getChangePurpose()+")"; | |||||
| } | |||||
| }else{ | |||||
| desc = "A端("+user.getUsername()+")操作未知积分来源"; | |||||
| } | |||||
| wxCreditHistory.setChangePurpose(desc); | |||||
| try { | try { | ||||
| wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),getTenantInfo()) ; | wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),getTenantInfo()) ; | ||||
| WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.domain.po; | package com.iformall.domain.po; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.domain.po.base.BaseTenantEntity; | import com.iformall.domain.po.base.BaseTenantEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| @@ -18,6 +19,10 @@ public class WxCUserCar extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | ||||
| private Long cUserId; | private Long cUserId; | ||||
| @TableField(exist = false) | |||||
| private String userPhone; | |||||
| @io.swagger.annotations.ApiModelProperty(value="车牌号",name="carNumber") | @io.swagger.annotations.ApiModelProperty(value="车牌号",name="carNumber") | ||||
| private String carNumber; | private String carNumber; | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| @@ -6,6 +6,9 @@ | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | ||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> | <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> | ||||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | <result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> | ||||
| <result column="phone" jdbcType="VARCHAR" property="userPhone" /> | |||||
| <result column="car_number" jdbcType="VARCHAR" property="carNumber" /> | <result column="car_number" jdbcType="VARCHAR" property="carNumber" /> | ||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | ||||
| @@ -15,80 +18,72 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`car_number`,`create_date`,`update_date`,`vendor_type`,`vendor_params`,`vendor_person_id` | |||||
| wcuc.`id`,wcuc.`tenant_id`,wcuc.`parent_tenant_id`,wcuc.`c_user_id`,wcuc.`car_number`,wcuc.`create_date`,wcuc.`update_date`,wcuc.`vendor_type`,wcuc.`vendor_params`,wcuc.`vendor_person_id`,wcubi.`phone` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| where 1 = 1 | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | |||||
| and wcuc.`id` = #{id} | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and `tenant_id` = #{tenantId} | |||||
| and wcuc.`tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | <if test=" null != parentTenantId and '' != parentTenantId"> | ||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| and wcuc.`parent_tenant_id` = #{parentTenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != cUserId "> | <if test=" null != cUserId "> | ||||
| and `c_user_id` = #{cUserId} | |||||
| and wcuc.`c_user_id` = #{cUserId} | |||||
| </if> | </if> | ||||
| <if test=" null != carNumber "> | <if test=" null != carNumber "> | ||||
| and `car_number` = #{carNumber} | |||||
| and wcuc.`car_number` = #{carNumber} | |||||
| </if> | </if> | ||||
| <!-- <if test=" null != carNumber "> | <!-- <if test=" null != carNumber "> | ||||
| and `car_number` like concat('%', #{carNumber},'%') | |||||
| and `car_number` like concat('%', #{carNumber},'%') | |||||
| </if> --> | </if> --> | ||||
| <if test=" null != createDate "> | <if test=" null != createDate "> | ||||
| and `create_date` = #{createDate} | |||||
| </if> | |||||
| <if test=" null != updateDate "> | |||||
| and `update_date` = #{updateDate} | |||||
| </if> | |||||
| and wcuc.`create_date` = #{createDate} | |||||
| </if> | |||||
| <if test=" null != vendorType "> | <if test=" null != vendorType "> | ||||
| and `vendor_type` = #{vendorType} | |||||
| and wcuc.`vendor_type` = #{vendorType} | |||||
| </if> | </if> | ||||
| <if test=" null != vendorParams "> | |||||
| and `vendor_params` like concat('%', #{vendorParams},'%') | |||||
| </if> | |||||
| <!--<if test=" null != vendorParams "> | |||||
| and `vendor_params` like concat('%', #{vendorParams},'%') | |||||
| </if>--> | |||||
| <if test=" null != vendorPersonId "> | <if test=" null != vendorPersonId "> | ||||
| and `vendor_person_id` = #{vendorPersonId} | |||||
| and wcuc.`vendor_person_id` = #{vendorPersonId} | |||||
| </if> | </if> | ||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | |||||
| and wcuc.id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| #{idItem} | #{idItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| <!-- <if test=" null != sortColumns"> order by ${sortColumns} </if>--> | |||||
| order by wcuc.create_date | |||||
| </sql> | </sql> | ||||
| <select id="findList" parameterType="com.iformall.domain.po.WxCUserCar" resultMap="BaseResultMap"> | <select id="findList" parameterType="com.iformall.domain.po.WxCUserCar" resultMap="BaseResultMap"> | ||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from wx_c_user_car | |||||
| from wx_c_user_car wcuc | |||||
| left join wx_c_user_basic_info wcubi on wcubi.id = wcuc.c_user_id | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| <if test=" null != userPhone"> | |||||
| and wcubi.`phone` = like concat('%', #{userPhone},'%') | |||||
| </if> | |||||
| </select> | </select> | ||||
| <select id="countList" parameterType="com.iformall.domain.po.WxCUserCar" resultType="java.lang.Integer"> | <select id="countList" parameterType="com.iformall.domain.po.WxCUserCar" resultType="java.lang.Integer"> | ||||
| select count(1) from wx_c_user_car | |||||
| select count(1) from wx_c_user_car wcuc | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||