Bläddra i källkod

[招商]adjust

release_toaliyun_real
Burce 6 år sedan
förälder
incheckning
901cd43ade
4 ändrade filer med 41 tillägg och 21 borttagningar
  1. +2
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java
  2. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/dto/InvestCustomerDto.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java
  4. +27
    -18
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java

+ 2
- 2
mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestDemandController.java Visa fil

@@ -70,8 +70,8 @@ public class InvestDemandController extends InvestBaseController {
*/
@SystemServiceLog
@PostMapping("/update")
public InvestResultData update(@RequestBody InvestCustomerDto investDemand) {
return execute(investDemand, p -> investBizService.updateCustomerAndDemand(p));
public InvestResultData update(@RequestBody InvestCustomerDto customerDto) {
return execute(customerDto, p -> investBizService.updateCustomerAndDemand(p));
}

/**


+ 11
- 0
mallinkService/src/main/java/com/iformall/domain/dto/InvestCustomerDto.java Visa fil

@@ -15,4 +15,15 @@ public class InvestCustomerDto extends InvestCustomerEntity {
@io.swagger.annotations.ApiModelProperty(value = "招商负责人", name = "owner")
@LogColumn
private Long owner;

@io.swagger.annotations.ApiModelProperty(value = "demandId", name = "demandId")
private Long demandId;

/**
* 客户意向
*/
@io.swagger.annotations.ApiModelProperty(value = "客户意向", name = "intent",
example = "\"{\"rent_area\":100,\"opening_time\": \"2019-09-03\"}\"")
@LogColumn(COLUMN_TYPE)
private String intent;
}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/invest/InvestBizService.java Visa fil

@@ -21,7 +21,7 @@ public interface InvestBizService {

boolean saveCustomerAndDemand(InvestCustomerDto customerDemandDto) ;

boolean updateCustomerAndDemand(InvestCustomerDto demandDto) ;
boolean updateCustomerAndDemand(InvestCustomerDto customerDto) ;

InvestDemandVo findDemandById(Long id) ;



+ 27
- 18
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java Visa fil

@@ -151,35 +151,44 @@ public class InvestBizServiceImpl implements InvestBizService {

@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveCustomerAndDemand(InvestCustomerDto demandDto) {
InvestHelper.notNull(demandDto);
InvestCustomerEntity customerEntity = demandDto;
InvestCustomerEntity customerEntityDB = customerService.getById(demandDto.getId());
if (Objects.nonNull(customerEntity)) {
if (Objects.isNull(customerEntityDB)) {
customerService.save(customerEntity);
} else {
customerService.updateById(customerEntity);
}
public boolean saveCustomerAndDemand(InvestCustomerDto customerDto) {
InvestHelper.notNull(customerDto);
InvestCustomerEntity customerEntityDB = customerService.getById(customerDto.getId());
if (Objects.isNull(customerEntityDB)) {
customerService.save(customerDto);
} else {
customerService.updateById(customerDto);
}
InvestDemandEntity demandEntity = new InvestDemandEntity();
BeanUtils.copyProperties(demandDto, demandEntity);
demandEntity.setCustomerId(customerEntity.getId());
setValDmand(customerDto, demandEntity);
return demandService.save(demandEntity);
}

@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateCustomerAndDemand(InvestCustomerDto demandDto) {
InvestHelper.notNull(demandDto, demandDto.getId());
InvestCustomerEntity customerEntity = demandDto;
InvestHelper.notNull(customerEntity);
public boolean updateCustomerAndDemand(InvestCustomerDto customerDto) {
InvestHelper.notNull(customerDto, customerDto.getDemandId());
InvestDemandEntity demandEntity = demandService.getByIdNotNull(customerDto.getDemandId());
InvestCustomerEntity customerEntity = new InvestCustomerEntity();
BeanUtils.copyProperties(customerDto, customerEntity);
customerEntity.setId(customerDto.getId());
customerService.updateById(customerEntity);
InvestDemandEntity demandEntity = new InvestDemandEntity();
BeanUtils.copyProperties(demandDto, demandEntity);
setValDmand(customerDto, demandEntity);
return demandService.updateById(demandEntity);
}

private void setValDmand(InvestCustomerDto customerDto, InvestDemandEntity demandEntity) {
if (Objects.isNull(demandEntity)) {
demandEntity = new InvestDemandEntity();
}
demandEntity.setCustomerId(customerDto.getId());
demandEntity.setId(customerDto.getDemandId());
demandEntity.setIntent(customerDto.getIntent());
if (Objects.nonNull(customerDto.getOwner())) {
demandEntity.setOwner(customerDto.getOwner());
}
}

@Override
public InvestDemandVo findDemandById(Long id) {
InvestDemandEntity demandEntity = demandService.getByIdNotNull(id);


Laddar…
Avbryt
Spara