Преглед изворни кода

[招商]adjust

release_toaliyun_real
Burce пре 6 година
родитељ
комит
f342753917
6 измењених фајлова са 39 додато и 10 уклоњено
  1. +4
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java
  2. +13
    -0
      mallinkService/src/main/java/com/iformall/domain/dto/InvestDemandDto.java
  3. +5
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestDemandVo.java
  4. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestFollowRecordVo.java
  5. +2
    -1
      mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java
  6. +13
    -6
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java

+ 4
- 3
mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java Прегледај датотеку

@@ -2,6 +2,7 @@ package com.iformall.controller.invest;

import com.iformall.annotation.SystemServiceLog;
import com.iformall.common.InvestResultData;
import com.iformall.domain.dto.InvestDemandDto;
import com.iformall.domain.po.InvestDemandEntity;
import com.iformall.domain.vo.invest.InvestDemandVo;
import com.iformall.domain.vo.invest.InvestPageQuery;
@@ -63,7 +64,7 @@ public class InvestDemandController extends InvestBaseController {
*/
@SystemServiceLog
@PostMapping("/save")
public InvestResultData save(InvestDemandVo investDemand) {
public InvestResultData save(@RequestBody InvestDemandDto investDemand) {
return execute(investDemand, p -> investBizService.saveCustomerAndDemand(p));
}

@@ -72,7 +73,7 @@ public class InvestDemandController extends InvestBaseController {
*/
@SystemServiceLog
@PostMapping("/update")
public InvestResultData update(InvestDemandVo investDemand) {
public InvestResultData update(@RequestBody InvestDemandVo investDemand) {
return execute(investDemand, p -> investBizService.updateCustomerAndDemand(p));
}

@@ -80,7 +81,7 @@ public class InvestDemandController extends InvestBaseController {
* 删除
*/
//@GetMapping("/delete")
public InvestResultData delete(Long[] ids) {
public InvestResultData delete(@RequestBody Long[] ids) {
return execute(ids, p -> investDemandService.removeByIds(Arrays.asList(p)));
}



+ 13
- 0
mallinkService/src/main/java/com/iformall/domain/dto/InvestDemandDto.java Прегледај датотеку

@@ -0,0 +1,13 @@
package com.iformall.domain.dto;

import com.iformall.domain.po.InvestCustomerEntity;
import com.iformall.domain.po.InvestDemandEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class InvestDemandDto extends InvestDemandEntity {
@io.swagger.annotations.ApiModelProperty(value = "customer", name = "customer",required = true)
private InvestCustomerEntity customer;
}

+ 5
- 0
mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestDemandVo.java Прегледај датотеку

@@ -6,15 +6,20 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBrand;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@Builder
@EqualsAndHashCode(callSuper = true)
public class InvestDemandVo<T> extends InvestDemandEntity {

@io.swagger.annotations.ApiModelProperty(value = "customer", name = "customer",required = true)
private InvestCustomerEntity customer;

@io.swagger.annotations.ApiModelProperty(value = "brand", name = "brand")
private WxBrand brand;

@io.swagger.annotations.ApiModelProperty(value = "ownerInfo", name = "ownerInfo")
private MallUserInfo ownerInfo;

private T targetInfo;


+ 2
- 0
mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestFollowRecordVo.java Прегледај датотеку

@@ -3,11 +3,13 @@ package com.iformall.domain.vo.invest;
import com.iformall.domain.po.*;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@Builder
@EqualsAndHashCode(callSuper = true)
public class InvestFollowRecordVo extends InvestFollowRecordEntity {

private InvestCustomerEntity customer;


+ 2
- 1
mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java Прегледај датотеку

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

import com.iformall.domain.dto.InvestDemandDto;
import com.iformall.domain.po.InvestDemandEntity;
import com.iformall.domain.po.InvestFollowRecordEntity;
import com.iformall.domain.po.InvestTaskEntity;
@@ -18,7 +19,7 @@ public interface InvestBizService {

List<MallUserInfo> queryUserList() ;

boolean saveCustomerAndDemand(InvestDemandVo customerDemandVo) ;
boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) ;

boolean updateCustomerAndDemand(InvestDemandVo customerDemandVo) ;



+ 13
- 6
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java Прегледај датотеку

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

import com.alibaba.fastjson.JSON;
import com.iformall.domain.dto.InvestDemandDto;
import com.iformall.domain.po.*;
import com.iformall.domain.vo.invest.*;
import com.iformall.service.MallUserInfoService;
@@ -128,13 +129,19 @@ public class InvestBizServiceImpl implements InvestBizService {

@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveCustomerAndDemand(InvestDemandVo customerDemandVo) {
InvestHelper.allNotNull(customerDemandVo);
InvestHelper.allNotNull(customerDemandVo.getBrand(), customerDemandVo.getCustomer());
InvestCustomerEntity customerEntity = customerDemandVo.getCustomer();
customerService.save(customerEntity);
public boolean saveCustomerAndDemand(InvestDemandDto customerDemandDto) {
InvestHelper.allNotNull(customerDemandDto, customerDemandDto.getCustomerId());
InvestCustomerEntity customerEntity = customerDemandDto.getCustomer();
InvestCustomerEntity customerEntityDB = customerService.getById(customerDemandDto.getCustomerId());
if (Objects.nonNull(customerEntity)) {
if (Objects.isNull(customerEntityDB)) {
customerService.save(customerEntity);
} else {
customerService.updateById(customerEntity);
}
}
InvestDemandEntity demandEntity = new InvestDemandEntity();
BeanUtils.copyProperties(customerDemandVo, demandEntity);
BeanUtils.copyProperties(customerDemandDto, demandEntity);
return demandService.save(demandEntity);
}



Loading…
Откажи
Сачувај