Browse Source

chepai

release_toaliyun_real
xhxu 5 years ago
parent
commit
f5fe59db96
4 changed files with 54 additions and 33 deletions
  1. +1
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserCarController.java
  2. +21
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java
  3. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCUserCar.java
  4. +27
    -32
      mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml

+ 1
- 0
mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCUserCarController.java View File

@@ -32,6 +32,7 @@ public class WxCUserCarController extends BaseController {
public ResultData list(@ModelAttribute WxCUserCar wxCUserCar, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxCUserCarController::list");
if (null == wxCUserCar) wxCUserCar = new WxCUserCar();
wxCUserCar.updateTenantInfo(getTenantInfo());
final PageInfo<WxCUserCar> page = wxCUserCarService.listAsPage(wxCUserCar, pageNum, pageSize);
return new ResultData(page);
}


+ 21
- 1
mallinkAdmin/src/main/java/com/iformall/controller/mem/WxCreditHistoryController.java View File

@@ -9,11 +9,15 @@ import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxCreditHistory;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxCreditHistoryVo;
import com.iformall.enums.EnumMerchantStatus;
import com.iformall.enums.EnumScoreType;
import com.iformall.enums.EnumUserType;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxCreditHistoryService;
import com.iformall.service.WxMerchantService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@@ -34,7 +38,10 @@ public class WxCreditHistoryController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxCreditHistoryService wxCreditHistoryService;
WxCreditHistoryService wxCreditHistoryService;

@Autowired
private WxMerchantService wxMerchantService;

@ApiOperation("分页列表接口")
@GetMapping("list")
@@ -87,6 +94,19 @@ public class WxCreditHistoryController extends BaseController {
wxCreditHistory.setOperatorId(user.getId());

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 {
wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),getTenantInfo()) ;
WxCreditHistory credit = wxCreditHistoryService.saveOrUpdate(wxCreditHistory);


+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCUserCar.java View File

@@ -1,5 +1,6 @@
package com.iformall.domain.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.BaseTenantEntity;
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")
private Long cUserId;

@TableField(exist = false)
private String userPhone;

@io.swagger.annotations.ApiModelProperty(value="车牌号",name="carNumber")
private String carNumber;
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")


+ 27
- 32
mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml View File

@@ -6,6 +6,9 @@
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<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="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
@@ -15,80 +18,72 @@
</resultMap>
<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 id="dynamicWhereConditions">
where 1 = 1
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
and wcuc.`id` = #{id}
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
and wcuc.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
and wcuc.`parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != cUserId ">
and `c_user_id` = #{cUserId}
and wcuc.`c_user_id` = #{cUserId}
</if>
<if test=" null != carNumber ">
and `car_number` = #{carNumber}
and wcuc.`car_number` = #{carNumber}
</if>
<!-- <if test=" null != carNumber ">
and `car_number` like concat('%', #{carNumber},'%')
and `car_number` like concat('%', #{carNumber},'%')
</if> -->
<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 ">
and `vendor_type` = #{vendorType}
and wcuc.`vendor_type` = #{vendorType}
</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 ">
and `vendor_person_id` = #{vendorPersonId}
and wcuc.`vendor_person_id` = #{vendorPersonId}
</if>
<if test=" null != ids ">
and id in
and wcuc.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
<!-- <if test=" null != sortColumns"> order by ${sortColumns} </if>-->
order by wcuc.create_date
</sql>
<select id="findList" parameterType="com.iformall.domain.po.WxCUserCar" resultMap="BaseResultMap">
select
<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" />
<if test=" null != userPhone">
and wcubi.`phone` = like concat('%', #{userPhone},'%')
</if>
</select>

<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" />
</select>



Loading…
Cancel
Save