|
|
|
@@ -23,6 +23,7 @@ import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.util.*; |
|
|
|
@@ -122,6 +123,11 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void importCustomer(MultipartFile mFile) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<InvestDemandVo> queryCustomer() { |
|
|
|
List<InvestCustomerEntity> customerEntities = customerService.list(); |
|
|
|
@@ -397,7 +403,9 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
customerService.save(customerEntity); |
|
|
|
InvestDemandEntity demandEntity = demandDto.getDemand(); |
|
|
|
demandEntity.setCustomerId(customerEntity.getId()); |
|
|
|
return demandService.save(demandEntity); |
|
|
|
demandService.save(demandEntity); |
|
|
|
saveMessage(demandEntity, demandDto.getCustomer()); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@@ -414,7 +422,20 @@ public class InvestBizServiceImpl implements InvestBizService { |
|
|
|
if (Objects.isNull(demandEntity.getCustomerId())) { |
|
|
|
demandEntity.setCustomerId(customerId); |
|
|
|
} |
|
|
|
return demandService.updateById(demandEntity); |
|
|
|
demandService.updateById(demandEntity); |
|
|
|
saveMessage(demandEntity, demandDto.getCustomer()); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
private void saveMessage(InvestDemandEntity entity, InvestCustomerEntity customerEntity) { |
|
|
|
if (Objects.isNull(entity)) { |
|
|
|
return; |
|
|
|
} |
|
|
|
Long owner = entity.getOwner(); |
|
|
|
if (Objects.nonNull(owner)) { |
|
|
|
List<Long> ownerArray = Arrays.asList(owner); |
|
|
|
demandService.saveBatchMessage(ownerArray, EnumInvestMessageType.CUSTOMER_CREATE.getInfo(), EnumInvestMessageTag.CUSTOMER_CREATE, EnumFollowType.DEMAND, customerEntity.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|