Explorar el Código

[储值卡][新增]:更新补贴记录

release_toaliyun_real
Stormeye Wu hace 7 años
padre
commit
4bc00c20cc
Se han modificado 3 ficheros con 24 adiciones y 6 borrados
  1. +15
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/WxMerchantSubsidyController.java
  2. +4
    -2
      mallinkService/src/main/java/com/iformall/service/WxMerchantSubsidyService.java
  3. +5
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantSubsidyServiceImpl.java

+ 15
- 2
mallinkAdmin/src/main/java/com/iformall/controller/WxMerchantSubsidyController.java Ver fichero

@@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;


import java.util.Date;
import java.util.Map; import java.util.Map;


@RestController @RestController
@@ -28,7 +29,7 @@ public class WxMerchantSubsidyController extends BaseController {
@GetMapping("sum") @GetMapping("sum")
public ResultData count(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy) { public ResultData count(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy) {
String ipStr = getIpAddr(); String ipStr = getIpAddr();
logger.info("subsidysum: " + ipStr + " :" + wxMerchantSubsidy.toString());
logger.info("subsidy/sum: " + ipStr + " :" + wxMerchantSubsidy.toString());
if (wxMerchantSubsidy == null) wxMerchantSubsidy = new WxMerchantSubsidy(); if (wxMerchantSubsidy == null) wxMerchantSubsidy = new WxMerchantSubsidy();
MallUserInfo user = getUser(); MallUserInfo user = getUser();
wxMerchantSubsidy.setTenantId(user.getTenantId()); wxMerchantSubsidy.setTenantId(user.getTenantId());
@@ -43,7 +44,7 @@ public class WxMerchantSubsidyController extends BaseController {
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData listMonth(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy, Integer pageNum, Integer pageSize) { public ResultData listMonth(@ModelAttribute WxMerchantSubsidy wxMerchantSubsidy, Integer pageNum, Integer pageSize) {
String ipStr = getIpAddr(); String ipStr = getIpAddr();
logger.info("subsidylist: " + ipStr + " :" + wxMerchantSubsidy.toString());
logger.info("subsidy/list: " + ipStr + " :" + wxMerchantSubsidy.toString());
if (wxMerchantSubsidy == null) wxMerchantSubsidy = new WxMerchantSubsidy(); if (wxMerchantSubsidy == null) wxMerchantSubsidy = new WxMerchantSubsidy();
MallUserInfo user = getUser(); MallUserInfo user = getUser();
wxMerchantSubsidy.setTenantId(user.getTenantId()); wxMerchantSubsidy.setTenantId(user.getTenantId());
@@ -51,4 +52,16 @@ public class WxMerchantSubsidyController extends BaseController {
return new ResultData(page); return new ResultData(page);
} }


@ApiOperation("更新补贴记录")
@PostMapping("update")
public ResultData listMonth(@RequestBody WxMerchantSubsidy wxMerchantSubsidy) {
String ipStr = getIpAddr();
logger.info("subsidy/update: " + ipStr + " :" + wxMerchantSubsidy.toString());
if (wxMerchantSubsidy == null) wxMerchantSubsidy = new WxMerchantSubsidy();
MallUserInfo user = getUser();
wxMerchantSubsidy.setTenantId(user.getTenantId());
wxMerchantSubsidy.setUpdateDate(new Date());
return wxMerchantSubsidyService.saveOrUpdate(wxMerchantSubsidy);
}

} }

+ 4
- 2
mallinkService/src/main/java/com/iformall/service/WxMerchantSubsidyService.java Ver fichero

@@ -1,6 +1,7 @@
package com.iformall.service; package com.iformall.service;


import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMerchantSubsidy; import com.iformall.domain.po.WxMerchantSubsidy;
import com.iformall.domain.vo.WxMerchantSubsidyVo; import com.iformall.domain.vo.WxMerchantSubsidyVo;


@@ -14,6 +15,7 @@ public interface WxMerchantSubsidyService {
* @return * @return
*/ */
Map<String, Object> sumForSubsidy(WxMerchantSubsidy record); Map<String, Object> sumForSubsidy(WxMerchantSubsidy record);

/** /**
* 根据实体查询分页列表 * 根据实体查询分页列表
* *
@@ -32,12 +34,12 @@ public interface WxMerchantSubsidyService {
*/ */
WxMerchantSubsidy getById(Long id); WxMerchantSubsidy getById(Long id);
/**
/**
* 保存或更新实体 * 保存或更新实体
* *
* @param record * @param record
*/ */
void saveOrUpdate(WxMerchantSubsidy record);
ResultData saveOrUpdate(WxMerchantSubsidy record);


/** /**
* 根据Id删除实体 * 根据Id删除实体


+ 5
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantSubsidyServiceImpl.java Ver fichero

@@ -2,6 +2,7 @@ package com.iformall.service.impl;


import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMerchantSubsidy; import com.iformall.domain.po.WxMerchantSubsidy;
import com.iformall.domain.vo.WxMerchantSubsidyVo; import com.iformall.domain.vo.WxMerchantSubsidyVo;
import com.iformall.mapper.WxMerchantSubsidyMapper; import com.iformall.mapper.WxMerchantSubsidyMapper;
@@ -35,15 +36,17 @@ public class WxMerchantSubsidyServiceImpl implements WxMerchantSubsidyService {
} }


@Override @Override
public void saveOrUpdate(WxMerchantSubsidy record) {
public ResultData saveOrUpdate(WxMerchantSubsidy record) {
if (record.getId() == null) { if (record.getId() == null) {
//record.setId(UUID.randomUUID().toString().replaceAll("-", "")); //record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId()); record.setId(idWorker.nextId());
wxMerchantSubsidyMapper.insertSelective(record); wxMerchantSubsidyMapper.insertSelective(record);
} else { } else {
wxMerchantSubsidyMapper.updateByPrimaryKeySelective(record);
int num = wxMerchantSubsidyMapper.updateByPrimaryKeySelective(record);
return new ResultData(num);
} }
return new ResultData();
} }


@Override @Override


Cargando…
Cancelar
Guardar