Просмотр исходного кода

B端交易金额和核销金额记录接口

release_toaliyun_real
jinguo24@163.com 7 лет назад
Родитель
Сommit
28dc919046
5 измененных файлов: 37 добавлений и 10 удалений
  1. +2
    -0
      mallinkBApi/src/main/java/com/simple/controller/WxDateAmountRecordController.java
  2. +1
    -1
      mallinkService/src/main/java/com/simple/mapper/WxDateAmountRecordMapper.java
  3. +10
    -2
      mallinkService/src/main/java/com/simple/service/WxDateAmountRecordService.java
  4. +19
    -7
      mallinkService/src/main/java/com/simple/service/impl/WxDateAmountRecordServiceImpl.java
  5. +5
    -0
      mallinkService/src/main/resources/mapper/WxDateAmountRecordMapper.xml

+ 2
- 0
mallinkBApi/src/main/java/com/simple/controller/WxDateAmountRecordController.java Просмотреть файл

@@ -6,6 +6,7 @@ import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@@ -36,6 +37,7 @@ public class WxDateAmountRecordController extends BaseController
@ApiImplicitParams({
@ApiImplicitParam(name="tenantId",value="租户id",dataType="String", paramType = "query",required=true),
@ApiImplicitParam(name="merchantId",value="商户id",dataType="long", paramType = "query",required=true)})
@GetMapping("list")
public ResultData getRecord(String tenantId,Long merchantId) {
Calendar c =Calendar.getInstance();
int weekOfYear =c.get(Calendar.WEEK_OF_YEAR);


+ 1
- 1
mallinkService/src/main/java/com/simple/mapper/WxDateAmountRecordMapper.java Просмотреть файл

@@ -9,7 +9,7 @@ public interface WxDateAmountRecordMapper extends CommonMapper<WxDateAmountRecor

List<WxDateAmountRecord> findList(WxDateAmountRecord wxDateAmountRecord);
int updateAmount(WxDateAmountRecord wxDateAmountRecord);



+ 10
- 2
mallinkService/src/main/java/com/simple/service/WxDateAmountRecordService.java Просмотреть файл

@@ -38,8 +38,16 @@ public interface WxDateAmountRecordService {
*/
void deleteById(Long id);
/**
* 修改交易核销
* @param tenantId 租户id
* @param merchantId 商户id
* @param type 类型 0 交易记录 1.核销记录
* @param payPrice 金额
* @return
*/
int updateAmount(String tenantId,Long merchantId
,Integer type,Integer payPrice);



+ 19
- 7
mallinkService/src/main/java/com/simple/service/impl/WxDateAmountRecordServiceImpl.java Просмотреть файл

@@ -43,12 +43,24 @@ public class WxDateAmountRecordServiceImpl implements WxDateAmountRecordService
public void deleteById(Long id) {
wxDateAmountRecordMapper.deleteByPrimaryKey(id);
}

@Override
public int updateAmount(String tenantId, Long merchantId, Integer type, Integer payPrice) {
Date now = new Date();
Calendar cal1 = Calendar.getInstance();
cal1.setTime(now); // 将时分秒,毫秒域清零
cal1.set(Calendar.HOUR_OF_DAY, 0);
cal1.set(Calendar.MINUTE, 0);
cal1.set(Calendar.SECOND, 0);
cal1.set(Calendar.MILLISECOND, 0);
now = cal1.getTime();
WxDateAmountRecord r = new WxDateAmountRecord();
r.setDate(now);
r.setTenantId(tenantId);
r.setMerchantId(merchantId);
r.setType(type);
r.setPayPrice(payPrice);
return wxDateAmountRecordMapper.updateAmount(r);
}
}

+ 5
- 0
mallinkService/src/main/resources/mapper/WxDateAmountRecordMapper.xml Просмотреть файл

@@ -90,7 +90,12 @@
<include refid="dynamicWhereConditions" />
</select>
<update id="updateAmount" parameterType="com.simple.domain.po.WxDateAmountRecord">
update wx_date_amount_record set pay_price=pay_price+#{payPrice}
where tenant_id=#{tenantId} and merchant_id=#{merchantId}
and type=#{type} and date = #{date}
</update>


Загрузка…
Отмена
Сохранить